Skip to content
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

No Data values for Enums #785

Open
lilleyse opened this issue Jan 15, 2025 · 3 comments
Open

No Data values for Enums #785

lilleyse opened this issue Jan 15, 2025 · 3 comments

Comments

@lilleyse
Copy link
Contributor

One limitation of using No Data values with ENUM properties is that it needs to be one of the enumerations. It would be nice if you could use a value not in the list like an empty string and some corresponding integer value for binary values.

From the 3D Metadata Specification:

For ENUM types, a noData value should contain the name of the enum value as a string, rather than its integer value.

@javagl
Copy link
Contributor

javagl commented Jan 15, 2025

The examples are usually pretty explicit with introducing a special value ("Unknown", -1) for this case. The validator also checks that it is a valid enum name.

It could indeed be simplified, but it might require additional constraints and corner cases to think through. You causally said

and some corresponding integer value

But it's not immediately obvious where this should be. One the purposes of the enum.value.schema.json is to establish the mapping between the name and the (integer) value (which I sometimes refer to as the "enum value value" for clarity 🙂 ). When the noData value is not the name of an enum value, we'd need some sort of noDataValue in addition to that...

@lilleyse
Copy link
Contributor Author

Maybe the maximum value could be used, e.g. 255 for UNSIGNED_BYTE, and those values would be restricted from normal usage.

@lilleyse
Copy link
Contributor Author

But I think noData + noDataValue would be ok too, and less likely to cause problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants