koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
104 stars 32 forks source link

Support variable coordinate precision #3

Closed dmfenton closed 7 years ago

dmfenton commented 7 years ago

From @slibby For geojson exports (and other formats) of large datasets, I think we may want to consider reducing decimal degree precision to reduce filesize. For complex polygon layers, the geometry section of the geojson file will take up the vast majority of the text space, and currently koop exports with 16-17 significant digits of precision:

"geometry": { "type": "Polygon", "coordinates": [ [ [ 85.275995105195037, 27.708265241160536 ], [ 85.273401891751973, 27.704288656786961 ], [ 85.268215466662468, 27.704288656786961 ], [ 85.265622253219405, 27.708265241160536 ], [ 85.268215466662468, 27.712241680589148 ], [ 85.273401891751973, 27.712241680589148 ], [ 85.275995105195037, 27.708265241160536 ] ] ] } }

Wikipedia shows us that 8 degrees of precision is down to 1mm of detail, which should be sufficient for most applications. Is it worth considering this when generating geojson, to save on disk and transfer overhead?

dmfenton commented 7 years ago

Implemented in https://github.com/FeatureServer/winnow/commit/bf747c0e76d1bb15a2e97db5b092a43caa596a45