mapbox / geobuf

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

Coordinate shifting for large polygons #98

Open gnitsua opened 6 years ago

gnitsua commented 6 years ago

I am using geobuf for encoding and decoding large geojson polygons for my project and have noticed that there seems to be some sort of error introduced by the encoding that compounds over time. This can result in polygons that are highly inaccurate for large perimeters. I know you guys have an accuracy of 1e6, but I feel like that is not what is causing this. Any help would be greatly appreciated. I am encoding using python and decoding using javascript

encoding_error

The problem: Results of encoding and decoding geojson seem to change coordinates for polygons with a large number of coordinates

Steps to reproduce: Github won't let me attach .json files directly, so I have compressed them. One file represents the unencoded data and the other after encoding and decoding with geobuf geojson.zip

mourner commented 6 years ago

Thanks for the report! This might be some kind of bug related to delta-encoding the coordinates. I'll investigate.

gnitsua commented 5 years ago

I think this may be related to https://github.com/pygeobuf/pygeobuf/issues/42 which may mean it is now fixed