systemed / tilemaker

Make OpenStreetMap vector tiles without the stack
https://tilemaker.org/
Other
1.4k stars 226 forks source link

AttributePair: use uint, not char #672

Closed cldellow closed 5 months ago

cldellow commented 5 months ago

Fixes #671

Since we only allocate 4 bits and char is signed, the usable space was -8..7. Larger values (like, say, 12) overflow, and get interpreted as a negative value, which means they don't act as a filter, since all zoom values are natural numbers.

The tests didn't actually test that a zoom value could be roundtripped. I updated them, and verified they failed before the code change, and passed after the code change.

I've also allocated an extra bit so that we support minzooms up to z31, vs just up to z15, since I think (?) some people generate up to z16

systemed commented 5 months ago

Thanks for tracking that one down!