CesiumGS / 3d-tiles

Specification for streaming massive heterogeneous 3D geospatial datasets :earth_americas:
2.04k stars 459 forks source link

Can the same property value be stored only once in the property table #705

Closed Error806 closed 1 year ago

Error806 commented 1 year ago

I have a lot of features that have the same string property values, and it seems that the same number of strings as the features need to be written to the table whether stored in b3dm's batchtable or glTF's EXT_structural_metadata extensions. Is it possible to store the same property value only once, and all feature's property refer to this value? Thanks. (From google translate)

lilleyse commented 1 year ago

Currently it's not possible, but I have two ideas for this:

Error806 commented 1 year ago

Thank you. I will try these ideas

lilleyse commented 1 year ago

Sounds good @Error806

And just to clarify you can try out the first idea now, but the second idea would require a spec change.

javagl commented 1 year ago

There are probably different options here, and maybe some details have to be clarified. Examples could help for the high-level pickture.

If this is about a table like


 ID  |  value
  0  |  "SomeExampleString"
  1  |  "SomeExampleString"
  2  |  "SomeExampleString"
  3  |  "SomeExampleString"
  ...
100  |  "SomeOtherExampleString"
101  |  "SomeOtherExampleString"
102  |  "SomeOtherExampleString"
103  |  "SomeOtherExampleString"
  ...
200  |  "AndYetAnotherString"
201  |  "AndYetAnotherString"
202  |  "AndYetAnotherString"
203  |  "AndYetAnotherString"

then it could indeed be wasteful to store the same string values many, many times. Depending on the exact structure, it should be possible to alleviate that with the first suggestion by Sean, as in

 ID  | stringId
  0  | 0
  1  | 0
  2  | 0
  3  | 0
  ...
100  | 1
101  | 1
102  | 1
103  | 1
  ...
200  | 2
201  | 2
202  | 2
203  | 2

with the stringId being a small (maybe UINT8) type that serves for the redirection into the table that contains the string values:

 ID  |  value
  0  |  "SomeExampleString"
  1  |  "SomeOtherExampleString"
  2  |  "AndYetAnotherString"

If this does not address the point here, then feel free to reopen this issue.