mapbox / geobuf

A compact binary encoding for geographic data.
ISC License
967 stars 84 forks source link

I Cannot decode geobuf with COORD_PRECISION different from 6 #126

Open valluzzi opened 2 years ago

valluzzi commented 2 years ago

I'm using python geobuf for encoding and javascript geobuf for decoding. All goes well while the coordinates decimal precision is unchanged and while features are encoded in EPSG:4326 (WGS84) where numbers are tiny ( < 180)

Using other reference systems like EPSG:32632 where numbers are bigger (like 4000000) pygeobuf crashes because with precision =6 it goes in number overflow. (but this is a pygeobuf problem). So I have to change precision in encoding to avoid crash and also to be more performant. Unfortunately in javascript geobuf, I have no options to do this. For sure, I can modify the source code but this is not the right way to do things also because I using npm to install it. I think a "precision argument" could be added in encoding like py geobuff. In my opinion this information could be added in geobuf protocol to avoid the decoder to knows in advance. But this is another story. Thankyou! I love geobuf