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

Numerically equal attribute values are equivalent #124

Open
e-n-f opened this issue Aug 22, 2018 · 1 comment
Open

Numerically equal attribute values are equivalent #124

e-n-f opened this issue Aug 22, 2018 · 1 comment

Comments

@e-n-f
Copy link
Contributor

e-n-f commented Aug 22, 2018

The spec should be clear that tile encoders may choose any representation (sint, uint, float, or double) for numeric attributes that correctly represents the value, and should choose the one that produces the smallest tile, rather than preserving the type of the original input value, so, for example, 2.0, 2, and 2u will all be represented as the same uint 2.

@joto
Copy link

joto commented Aug 23, 2018

Not sure this is a "should", especially because you might want to keep types consistent between features in the same layer, so if one width property is 2.0 and another is 2.5, you might want them both to be floats, because thats how you use them in the stylesheet or whatever is interpreting your data.

Also conversions back and forth between different numeric types do not necessarily preserve the values.

So I don't think this is something that the spec should get involved in. All the spec guarantees is that if you put a value of a certain type in when creating the tile, it will come out with the same type and same value on the other side. How you encode your values is up to you and it depends on what you expect will read the tiles.

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