[GIS] How to limit decimal digit of GeoJSON

geojsonpostgis

I am using postGIS. I am using ST_AsGeoJSON(geom) function to get GeoJSON data of Geom field. Its returning a long lat value that have 13 digits after decimal point. Is there any way to reduce or limit the decimal digits?

Best Answer

Read the documentation of the method. You can pass a parameter to limit the number of decimal digits.

text ST_AsGeoJSON(geography geog, integer maxdecimaldigits=15, integer options=0);