-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding for object/array subtypes (e.g raster-cube)? #299
Comments
Working with multidimension JSON arrays is probably fine for small examples and tests, but for larger cases (and to also cover nan/inf/...) you might want the option to have the cube's data as a binary blob, encoded as a string in hex or base64 for example. Related: some notion of the data type (signed/unsigned bool/byte/int8/int/float/double/ ...) should probably be considered too |
Yes, this is mostly meant for small chunks and tests. Nevertheless, the nan and +/-inf issue is somewhat a blocker for me, but we may still allow the limited JSON as a simple way of doing things and find an alternative for these special cases. Binary is also not straightforward though as you've mentioned with e.g. data types etc. If we need the data type details in the metadata though, we can just re-use what has been defined in STAC. |
just a quick note (and I haven't checked if this is some kind of standardized extension) but the standard json module in python does support encoding NaN and infinity in JSON (by default):
|
That's unfortunately a Python-specific thing and not supported in other environments. In JS (and most other languages) this will lead to an error. |
Once this is done, update the implementation guide (chapter 'log process') correspondingly. |
We have some subtypes such as
raster-cube
,vector-cube
andlabeled-array
that don't have an encoding in JSON and with the subtypes we work around that. For examples and tests (see #204) it would be good to have a JSON encoding defined for them.For example,
raster-cube
could be encoded as follows:Nevertheless, in raster-cube you'd have the issue that some values can't be represented (i.e. nan and +/-inf)
For example,
labeled-array
could be encoded as follows:The text was updated successfully, but these errors were encountered: