[postgis-tickets] r17707 - Lower default precision produced by ST_AsGeoJSON

Paul Ramsey pramsey at cleverelephant.ca
Tue Aug 13 11:00:13 PDT 2019


Author: pramsey
Date: 2019-08-13 11:00:13 -0700 (Tue, 13 Aug 2019)
New Revision: 17707

Modified:
   trunk/postgis/geography.sql.in
   trunk/postgis/postgis.sql.in
Log:
Lower default precision produced by ST_AsGeoJSON
References #4468


Modified: trunk/postgis/geography.sql.in
===================================================================
--- trunk/postgis/geography.sql.in	2019-08-13 16:59:20 UTC (rev 17706)
+++ trunk/postgis/geography.sql.in	2019-08-13 18:00:13 UTC (rev 17707)
@@ -466,7 +466,7 @@
 -- GeoJson Output
 --
 
-CREATE OR REPLACE FUNCTION ST_AsGeoJson(geog geography, maxdecimaldigits int4 DEFAULT 15, options int4 DEFAULT 0)
+CREATE OR REPLACE FUNCTION ST_AsGeoJson(geog geography, maxdecimaldigits int4 DEFAULT 9, options int4 DEFAULT 0)
 	RETURNS text
 	AS 'MODULE_PATHNAME','geography_as_geojson'
 	LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL
@@ -476,7 +476,7 @@
 -- Deprecated in 2.0.0
 CREATE OR REPLACE FUNCTION ST_AsGeoJson(text)
 	RETURNS text AS
-	$$ SELECT @extschema at .ST_AsGeoJson($1::@extschema at .geometry,15,0);  $$
+	$$ SELECT @extschema at .ST_AsGeoJson($1::@extschema at .geometry, 9, 0);  $$
 	LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
 

Modified: trunk/postgis/postgis.sql.in
===================================================================
--- trunk/postgis/postgis.sql.in	2019-08-13 16:59:20 UTC (rev 17706)
+++ trunk/postgis/postgis.sql.in	2019-08-13 18:00:13 UTC (rev 17707)
@@ -4602,7 +4602,7 @@
 -- ST_AsGeoJson(geom, precision, options) / version=1
 -- Changed: 2.0.0 to use default args and named args
 -- Changed: 3.0.0 change default args mode
-CREATE OR REPLACE FUNCTION ST_AsGeoJson(geom geometry, maxdecimaldigits int4 DEFAULT 15, options int4 DEFAULT 8)
+CREATE OR REPLACE FUNCTION ST_AsGeoJson(geom geometry, maxdecimaldigits int4 DEFAULT 9, options int4 DEFAULT 8)
 	RETURNS text
 	AS 'MODULE_PATHNAME','LWGEOM_asGeoJson'
 	LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL
@@ -4609,7 +4609,7 @@
 	_COST_LOW;
 
 -- Availability: 3.0.0
-CREATE OR REPLACE FUNCTION ST_AsGeoJson(r record, geom_column text DEFAULT '', maxdecimaldigits int4 DEFAULT 15, pretty_bool bool DEFAULT false)
+CREATE OR REPLACE FUNCTION ST_AsGeoJson(r record, geom_column text DEFAULT '', maxdecimaldigits int4 DEFAULT 9, pretty_bool bool DEFAULT false)
 	RETURNS text
 	AS 'MODULE_PATHNAME','ST_AsGeoJsonRow'
 	LANGUAGE 'c' STABLE STRICT _PARALLEL



More information about the postgis-tickets mailing list