I am using ogr2ogr to convert the data from PostgreSQL to GeoJSON. PostgreSQL contains field named shape.area, type numeric, which stores values up to 17 decimal places, like 0.15627328781960101.
The conversion to the GeoJSON is successful, but the decimal digits for shape.area field are rounded to 6 decimal places producing the value 0.156273.
The coordinate values are displayed with 15 decimal places and that is good.
I am using this command for the conversion:
ogr2ogr -f "GeoJSON" "D:\test.geojson" PG:"host=localhost user=postgres dbname=xx active_schema=xx password=xx port=5432" "table"
I did try this conversion with GDAL 2.0.2 on CentOS and 1.11.3 on Win and the rounding is the same. The conversion to shapefile preserves the precision so this must have to do something specifically with the conversion to GeoJSON.
Am I missing some configuration switch? Is there a way to preserve the precision while exporting numeric values to GeoJSON format?