mapbox / geobuf

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

Fix accumulating precision errors in delta encoding. #56

Closed jamesbursa closed 8 years ago

jamesbursa commented 8 years ago

I came across a problem with geobuf when converting certain Shapefiles to geobuf and then reading back the data. For some features, polygon points were offset from the original position.

For example, with a 60,000+ point polygon (from the NY https://coast.noaa.gov/slrdata/ file) the error was 10m+ in some areas.

Please see the test case that shows the problem. I've also included a fix that solved it for me.

mourner commented 8 years ago

This is great, thanks for the PR! I wonder why Travis didn't build this... Merged as https://github.com/mapbox/geobuf/commit/ee5f98ce1c7d4f7cacbe88f8268d22ce128143c2 (with some whitespace/linting fixes)