From 9e6979d5c81a4bf04d38c3b13cc901a024c201c6 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 13 Aug 2019 18:00:13 +0000 Subject: [PATCH] Lower default precision produced by ST_AsGeoJSON References #4468 git-svn-id: http://svn.osgeo.org/postgis/trunk@17707 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/geography.sql.in | 4 ++-- postgis/postgis.sql.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/postgis/geography.sql.in b/postgis/geography.sql.in index 8a7b9567c..add7d1c10 100644 --- a/postgis/geography.sql.in +++ b/postgis/geography.sql.in @@ -466,7 +466,7 @@ CREATE OR REPLACE FUNCTION ST_AsKML(text) -- 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 @@ CREATE OR REPLACE FUNCTION ST_AsGeoJson(geog geography, maxdecimaldigits int4 DE -- Deprecated in 2.0.0 CREATE OR REPLACE FUNCTION ST_AsGeoJson(text) RETURNS text AS - $$ SELECT @extschema@.ST_AsGeoJson($1::@extschema@.geometry,15,0); $$ + $$ SELECT @extschema@.ST_AsGeoJson($1::@extschema@.geometry, 9, 0); $$ LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL; diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 140efb682..9a489d935 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -4602,14 +4602,14 @@ CREATE OR REPLACE FUNCTION ST_AsKML(geom geometry, maxdecimaldigits int4 DEFAULT -- 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 _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 -- 2.40.0