[postgis-devel] GeoJSON Precision

Paul Ramsey pramsey at cleverelephant.ca
Tue May 7 13:40:41 PDT 2019


> On May 7, 2019, at 4:39 PM, Even Rouault <even.rouault at spatialys.com> wrote:
> 
> On mardi 7 mai 2019 16:17:15 CEST Paul Ramsey wrote:
>> This blog post reminded me:
>> 
>> https://rapidlasso.com/2019/05/06/how-many-decimal-digits-for-storing-longit
>> ude-latitude/
>> <https://rapidlasso.com/2019/05/06/how-many-decimal-digits-for-storing-long
>> itude-latitude/>
>> 
>> GeoJSON generation uses DBL_DIG as the number of decimal places, which is… a
>> lot? 15 or 16 depending on your platform. I wonder if maybe we should crank
>> that down to 8 as the default and let people crank it *up* as desired
>> rather than emitting nanometer precision and expecting people to crank it
>> *down* (they don’t).
> 
> For what is worth, https://tools.ietf.org/html/rfc7946 mentions in  11.2.  
> Coordinate Precision
> 
> """
> For geographic coordinates with units of degrees, 6 decimal places (a default 
> common in, e.g., sprintf) amounts to about 10 centimeters, a precision well
> within that of current GPS systems.
> """
> 
> Looking at GDAL implementation of RFC7946, I see we are actually using 7 
> decimals.

Worth a lot. 6 is really tempting :)

P

> 
> Even
> 
> -- 
> Spatialys - Geospatial professional services
> http://www.spatialys.com



More information about the postgis-devel mailing list