[postgis-tickets] r17678 - Improve GeoJSON SRID handling.

Darafei komzpa at gmail.com
Tue Aug 6 12:15:24 PDT 2019


Author: komzpa
Date: 2019-08-06 12:15:24 -0700 (Tue, 06 Aug 2019)
New Revision: 17678

Modified:
   trunk/NEWS
   trunk/doc/reference_input.xml
   trunk/doc/reference_output.xml
   trunk/extras/ogc_test_suite/3_cleanup.sql
   trunk/liblwgeom/liblwgeom.h.in
   trunk/postgis/lwgeom_export.c
   trunk/postgis/lwgeom_in_geojson.c
   trunk/postgis/postgis.sql.in
   trunk/postgis/postgis_after_upgrade.sql
   trunk/raster/test/regress/loader/Projected-post.sql
   trunk/raster/test/regress/loader/Projected-pre.sql
   trunk/regress/core/geography.sql
   trunk/regress/core/in_geojson.sql
   trunk/regress/core/in_geojson_expected
   trunk/regress/core/in_gml.sql
   trunk/regress/core/in_kml.sql
   trunk/regress/core/knn_recheck.sql
   trunk/regress/core/legacy.sql
   trunk/regress/core/out_geography.sql
   trunk/regress/core/out_geography_expected
   trunk/regress/core/out_geometry.sql
   trunk/regress/core/out_geometry_expected
   trunk/regress/core/regress_management.sql
   trunk/regress/core/regress_proj.sql
   trunk/regress/core/tickets.sql
   trunk/regress/loader/ReprojectPts-post.sql
   trunk/regress/loader/ReprojectPts-pre.sql
   trunk/regress/loader/ReprojectPtsD-post.sql
   trunk/regress/loader/ReprojectPtsD-pre.sql
   trunk/regress/loader/ReprojectPtsGeog-post.sql
   trunk/regress/loader/ReprojectPtsGeog-pre.sql
   trunk/regress/loader/ReprojectPtsGeogD-post.sql
   trunk/regress/loader/ReprojectPtsGeogD-pre.sql
   trunk/regress/run_test.pl
   trunk/topology/test/regress/copytopology.sql
   trunk/topology/test/regress/gml.sql
   trunk/topology/test/regress/st_createtopogeo.sql
   trunk/topology/test/regress/st_modedgesplit.sql
   trunk/topology/test/regress/st_newedgessplit.sql
   trunk/topology/test/regress/st_remedgemodface.sql
   trunk/topology/test/regress/st_remedgenewface.sql
   trunk/topology/test/regress/topogeo_addlinestring.sql
Log:
Improve GeoJSON SRID handling.

If SRID is not specified, set it to 4326 by default on parsing, following RFC7946.
If SRID is not 4326 on serialization, it will be marked in JSON unless disabled, making round trips almost lossless.

Fixes spatial_ref_sys truncation in all the tests.
Closes #4377
Closes https://github.com/postgis/postgis/pull/455




Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/NEWS	2019-08-06 19:15:24 UTC (rev 17678)
@@ -197,8 +197,11 @@
   - #4410, More descriptive error messages about SRID mismatch (Darafei Praliaskouski)
   - #4399, TIN and Triangle output support in all output functions (Darafei
            Praliaskouski)
-  - #3719, Impose minimun number of segments per arc during linearization
+  - #3719, Impose minimum number of segments per arc during linearization
            (Dan Baston / City of Helsinki, Raúl Marín)
+  - #4277, ST_GeomFromGeoJSON now marks SRID=4326 by default as per RFC7946,
+           ST_AsGeoJSON sets SRID in JSON output if it differs from 4326.
+           (Darafei Praliaskouski)
 
 * Fixes *
   - #4342, Move deprecated functions into legacy.sql file

Modified: trunk/doc/reference_input.xml
===================================================================
--- trunk/doc/reference_input.xml	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/doc/reference_input.xml	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1544,6 +1544,7 @@
 		<para>Constructs a PostGIS geometry object from the GeoJSON representation.</para>
 		<para>ST_GeomFromGeoJSON works only for JSON Geometry fragments. It throws an error if you try to use it on a whole JSON document.</para>
 
+		<para>Enhanced: 3.0.0 parsed geometry defaults to SRID=4326 if not specified otherwise.</para>
 		<para>Enhanced: 2.5.0 can now accept json and jsonb as inputs.</para>
 		<para>Availability: 2.0.0 requires - JSON-C >= 0.9</para>
 		<note><para>If you do not have JSON-C enabled, support you will get an error notice instead of seeing an output.

Modified: trunk/doc/reference_output.xml
===================================================================
--- trunk/doc/reference_output.xml	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/doc/reference_output.xml	2019-08-06 19:15:24 UTC (rev 17678)
@@ -555,7 +555,7 @@
 				<funcdef>text <function>ST_AsGeoJSON</function></funcdef>
 				<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
 				<paramdef choice="opt"><type>integer </type> <parameter>maxdecimaldigits=15</parameter></paramdef>
-				<paramdef choice="opt"><type>integer </type> <parameter>options=0</parameter></paramdef>
+				<paramdef choice="opt"><type>integer </type> <parameter>options=8</parameter></paramdef>
 			</funcprototype>
 			<funcprototype>
 				<funcdef>text <function>ST_AsGeoJSON</function></funcdef>
@@ -577,7 +577,7 @@
 			<para>The <varname>options</varname> argument could be used to add BBOX or CRS in GeoJSON output:
 			  <itemizedlist>
 				<listitem>
-				  <para>0: means no option (default value)</para>
+				  <para>0: means no option</para>
 				</listitem>
 
 				<listitem>
@@ -591,6 +591,10 @@
 				<listitem>
 				  <para>4: GeoJSON Long CRS (e.g urn:ogc:def:crs:EPSG::4326)</para>
 				</listitem>
+
+				<listitem>
+				  <para>8: GeoJSON Short CRS if not EPSG:4326 (default)</para>
+				</listitem>
 			  </itemizedlist>
 			</para>
 
@@ -598,6 +602,7 @@
 			<para>Availability: 1.5.0 geography support was introduced.</para>
 			<para>Changed: 2.0.0 support default args and named args.</para>
 			<para>Changed: 3.0.0 support records as input</para>
+			<para>Changed: 3.0.0 output SRID if not EPSG:4326.</para>
 			<para>&Z_support;</para>
 	  </refsection>
 

Modified: trunk/extras/ogc_test_suite/3_cleanup.sql
===================================================================
--- trunk/extras/ogc_test_suite/3_cleanup.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/extras/ogc_test_suite/3_cleanup.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -4,7 +4,7 @@
 -- OGC will not examine this script for adaptations.
 -- Please add any other cleanup to this script.
 --
-DELETE FROM spatial_ref_sys;
+--DELETE FROM spatial_ref_sys;
 DELETE FROM geometry_columns;
 DROP TABLE lakes;
 DROP TABLE road_segments;

Modified: trunk/liblwgeom/liblwgeom.h.in
===================================================================
--- trunk/liblwgeom/liblwgeom.h.in	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/liblwgeom/liblwgeom.h.in	2019-08-06 19:15:24 UTC (rev 17678)
@@ -160,6 +160,7 @@
 #define WGS84_INVERSE_FLATTENING 298.257223563
 #define WGS84_MINOR_AXIS (WGS84_MAJOR_AXIS - WGS84_MAJOR_AXIS / WGS84_INVERSE_FLATTENING)
 #define WGS84_RADIUS ((2.0 * WGS84_MAJOR_AXIS + WGS84_MINOR_AXIS ) / 3.0)
+#define WGS84_SRID 4326
 
 
 /**

Modified: trunk/postgis/lwgeom_export.c
===================================================================
--- trunk/postgis/lwgeom_export.c	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/postgis/lwgeom_export.c	2019-08-06 19:15:24 UTC (rev 17678)
@@ -354,15 +354,20 @@
 	LWGEOM *lwgeom;
 	char *geojson;
 	text *result;
-	int has_bbox = 0;
 	int precision = DBL_DIG;
+	int output_bbox = LW_FALSE;
+	int output_long_crs = LW_FALSE;
+	int output_short_crs = LW_FALSE;
+	int output_guess_short_srid = LW_FALSE;
 	char *srs = NULL;
+	int32_t srid;
 
 	/* Get the geometry */
-	if ( PG_ARGISNULL(0) )
+	if (PG_ARGISNULL(0))
 		PG_RETURN_NULL();
 
 	geom = PG_GETARG_GSERIALIZED_P(0);
+	srid = gserialized_get_srid(geom);
 
 	/* Retrieve precision if any (default is max) */
 	if ( PG_NARGS() > 1 && !PG_ARGISNULL(1) )
@@ -375,42 +380,39 @@
 	}
 
 	/* Retrieve output option
-	 * 0 = without option (default)
+	 * 0 = without option
 	 * 1 = bbox
 	 * 2 = short crs
 	 * 4 = long crs
+	 * 8 = guess if CRS is needed (default)
 	 */
-	if ( PG_NARGS() > 2 && !PG_ARGISNULL(2) )
+	if (PG_NARGS() > 2 && !PG_ARGISNULL(2))
 	{
 		int option = PG_GETARG_INT32(2);
+		output_guess_short_srid = (option & 8) ? LW_TRUE : LW_FALSE;
+		output_short_crs = (option & 2) ? LW_TRUE : LW_FALSE;
+		output_long_crs = (option & 4) ? LW_TRUE : LW_FALSE;
+		output_bbox = (option & 1) ? LW_TRUE : LW_FALSE;
+	}
+	else
+		output_guess_short_srid = LW_TRUE;
 
-		if ( option & 2 || option & 4 )
-		{
-			int32_t srid = gserialized_get_srid(geom);
-			if ( srid != SRID_UNKNOWN )
-			{
-				if ( option & 2 )
-					srs = getSRSbySRID(srid, true);
+	if (output_guess_short_srid && srid != WGS84_SRID && srid != SRID_UNKNOWN)
+		output_short_crs = LW_TRUE;
 
-				if ( option & 4 )
-					srs = getSRSbySRID(srid, false);
+	if (srid != SRID_UNKNOWN && (output_short_crs || output_long_crs))
+	{
+		srs = getSRSbySRID(srid, !output_long_crs);
 
-				if ( !srs )
-				{
-					elog(ERROR,
-					      "SRID %i unknown in spatial_ref_sys table",
-					      srid);
-					PG_RETURN_NULL();
-				}
-			}
+		if (!srs)
+		{
+			elog(ERROR, "SRID %i unknown in spatial_ref_sys table", srid);
+			PG_RETURN_NULL();
 		}
-
-		if (option & 1)
-			has_bbox = 1;
 	}
 
 	lwgeom = lwgeom_from_gserialized(geom);
-	geojson = lwgeom_to_geojson(lwgeom, srs, precision, has_bbox);
+	geojson = lwgeom_to_geojson(lwgeom, srs, precision, output_bbox);
 	lwgeom_free(lwgeom);
 
 	if (srs) pfree(srs);

Modified: trunk/postgis/lwgeom_in_geojson.c
===================================================================
--- trunk/postgis/lwgeom_in_geojson.c	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/postgis/lwgeom_in_geojson.c	2019-08-06 19:15:24 UTC (rev 17678)
@@ -91,6 +91,7 @@
 	text *geojson_input;
 	char *geojson;
 	char *srs = NULL;
+	int32_t srid = WGS84_SRID;
 
 	/* Get the geojson stream */
 	if (PG_ARGISNULL(0))
@@ -100,7 +101,7 @@
 	geojson = text2cstring(geojson_input);
 
 	lwgeom = lwgeom_from_geojson(geojson, &srs);
-	if ( ! lwgeom )
+	if (!lwgeom)
 	{
 		/* Shouldn't get here */
 		elog(ERROR, "lwgeom_from_geojson returned NULL");
@@ -107,12 +108,13 @@
 		PG_RETURN_NULL();
 	}
 
-	if ( srs )
+	if (srs)
 	{
-		lwgeom_set_srid(lwgeom, getSRIDbySRS(srs));
+		srid = getSRIDbySRS(srs);
 		lwfree(srs);
 	}
 
+	lwgeom_set_srid(lwgeom, srid);
 	geom = geometry_serialize(lwgeom);
 	lwgeom_free(lwgeom);
 
@@ -119,4 +121,3 @@
 	PG_RETURN_POINTER(geom);
 #endif
 }
-

Modified: trunk/postgis/postgis.sql.in
===================================================================
--- trunk/postgis/postgis.sql.in	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/postgis/postgis.sql.in	2019-08-06 19:15:24 UTC (rev 17678)
@@ -4600,8 +4600,9 @@
 -----------------------------------------------------------------------
 
 -- ST_AsGeoJson(geom, precision, options) / version=1
--- Changed 2.0.0 to use default args and named args
-CREATE OR REPLACE FUNCTION ST_AsGeoJson(geom geometry, maxdecimaldigits int4 DEFAULT 15, options int4 DEFAULT 0)
+-- 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)
 	RETURNS text
 	AS 'MODULE_PATHNAME','LWGEOM_asGeoJson'
 	LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL

Modified: trunk/postgis/postgis_after_upgrade.sql
===================================================================
--- trunk/postgis/postgis_after_upgrade.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/postgis/postgis_after_upgrade.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -62,8 +62,8 @@
 DROP FUNCTION IF EXISTS ST_AsGeoJson(geography, int4); -- this one changed to use default args
 DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geometry); -- this one changed to use default args
 DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geography); -- this one changed to use default args
-DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geometry,int4); -- this one changed to use default args
-DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geography,int4); -- this one changed to use default args
+DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geometry, int4); -- this one changed to use default args
+DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geography, int4); -- this one changed to use default args
 DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geography, int4, int4); -- dropped because the version-first signature is dumb
 DROP FUNCTION IF EXISTS _ST_AsGeoJson(int4, geometry, int4, int4); -- dropped in PostGIS-3.0 (r17300)
 DROP FUNCTION IF EXISTS _ST_AsGeoJson(int4, geography, int4, int4); -- dropped in PostGIS-3.0 (r17300)

Modified: trunk/raster/test/regress/loader/Projected-post.sql
===================================================================
--- trunk/raster/test/regress/loader/Projected-post.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/raster/test/regress/loader/Projected-post.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,4 +1,2 @@
-TRUNCATE spatial_ref_sys;
--- should this be done automatically ?
 -- "loadedrast" is removed automatically !
 DROP TABLE o_2_loadedrast;

Modified: trunk/raster/test/regress/loader/Projected-pre.sql
===================================================================
--- trunk/raster/test/regress/loader/Projected-pre.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/raster/test/regress/loader/Projected-pre.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,8 +0,0 @@
--- NOTE: the need for truncation here reveals a leak bug in previous tests
-TRUNCATE spatial_ref_sys;
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text")
-VALUES
-(4326,'EPSG',4326,'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ')
-,
-('3857','EPSG','3857','PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],AUTHORITY["EPSG","3857"],AXIS["X",EAST],AXIS["Y",NORTH]]','+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs')
-;

Modified: trunk/regress/core/geography.sql
===================================================================
--- trunk/regress/core/geography.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/geography.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,21 +1,3 @@
-INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text)
-VALUES (
- '4326',
- 'EPSG',
- '4326',
- 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]',
- '+proj=longlat +datum=WGS84 +no_defs'
-);
-
-INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text)
-VALUES (
- '4269',
- 'EPSG',
- '4269',
- 'GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]]',
- '+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs'
-);
-
 -- Do cached and uncached distance agree?
 SELECT c, abs(ST_Distance(ply::geography, pt::geography) - _ST_DistanceUnCached(ply::geography, pt::geography)) < 0.01 FROM
 ( VALUES
@@ -142,6 +124,3 @@
 select 'dwithin_poly_poly_1', ST_DWithin('POLYGON((0 0, -2 -2, -3 0, 0 0))'::geography, 'POLYGON((1 1, 2 2, 3 0, 1 1))'::geography, 10);
 select 'dwithin_poly_poly_2', ST_DWithin('POLYGON((0 0, -2 -2, -3 0, 0 0))'::geography, 'POLYGON((1 1, 2 2, 3 0, 1 1))'::geography, 300000);
 select 'dwithin_poly_poly_3', ST_DWithin('POLYGON((1 1, -2 -2, -3 0, 1 1))'::geography, 'POLYGON((1 1, 2 2, 3 0, 1 1))'::geography, 300000);
-
--- Clean up spatial_ref_sys
-DELETE FROM spatial_ref_sys WHERE srid IN (4269, 4326);

Modified: trunk/regress/core/in_geojson.sql
===================================================================
--- trunk/regress/core/in_geojson.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/in_geojson.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,12 +1,13 @@
 -- FromGeoJSON
-select 'geomfromgeojson_01',st_asewkt(st_geomfromgeojson(st_asgeojson('SRID=3005;MULTIPOINT(1 1, 1 1)')));
-select 'geomfromgeojson_02',st_astext(st_geomfromgeojson(st_asgeojson('SRID=3005;MULTIPOINT(1 1, 1 1)')));
-select 'geomfromgeojson_03',st_astext(st_geomfromgeojson(st_asgeojson('POINT(1 1)')));
-select 'geomfromgeojson_04',st_astext(st_geomfromgeojson(st_asgeojson('LINESTRING(0 0,1 1)')));
-select 'geomfromgeojson_05',st_astext(st_geomfromgeojson(st_asgeojson('POLYGON((0 0,1 1,1 0,0 0))')));
-select 'geomfromgeojson_06',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLYGON(((0 0,1 1,1 0,0 0)))')));
-select 'geomfromgeojson_07',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLYGON(((0 0,1 1,1 0,0 0)))')::json));
-select 'geomfromgeojson_08',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLYGON(((0 0,1 1,1 0,0 0)))')::jsonb));
+select 'geomfromgeojson_01',st_asewkt(st_geomfromgeojson(st_asgeojson('SRID=3005;MULTIPOINT(1 1, 1 1)'::geometry)));
+select 'geomfromgeojson_02',st_astext(st_geomfromgeojson(st_asgeojson('SRID=3005;MULTIPOINT(1 1, 1 1)'::geometry)));
+select 'geomfromgeojson_03',st_astext(st_geomfromgeojson(st_asgeojson('POINT(1 1)'::geometry)));
+select 'geomfromgeojson_04',st_astext(st_geomfromgeojson(st_asgeojson('LINESTRING(0 0,1 1)'::geometry)));
+select 'geomfromgeojson_05',st_astext(st_geomfromgeojson(st_asgeojson('POLYGON((0 0,1 1,1 0,0 0))'::geometry)));
+select 'geomfromgeojson_06',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLYGON(((0 0,1 1,1 0,0 0)))'::geometry)));
+select 'geomfromgeojson_07',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLYGON(((0 0,1 1,1 0,0 0)))'::geometry)::json));
+select 'geomfromgeojson_08',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLYGON(((0 0,1 1,1 0,0 0)))'::geometry)::jsonb));
+select 'geomfromgeojson_09',st_asewkt(st_geomfromgeojson(st_asgeojson('SRID=3005;MULTIPOINT(1 1, 1 1)'::geography)));
 -- #1434
 select '#1434: Next two errors';
 select '#1434.1',ST_GeomFromGeoJSON('{ "type": "Point", "crashme": [100.0, 0.0] }');
@@ -33,19 +34,19 @@
 SELECT '#2697', ST_GeomFromGeoJSON('{"type":"Polygon","coordinates":[1,1]}');
 
 -- FromGeoJSON 3D
-
 SELECT 'geomfromgeojson_z_01', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"Point","coordinates":[1,2,3]}'));
 SELECT 'geomfromgeojson_z_02', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[1,2,3],[2,3,4]]}'));
 
 -- FromGeoJSON 4D
-
 SELECT 'geomfromgeojson_zm_01', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"Point","coordinates":[1,2,3,4]}'));
 SELECT 'geomfromgeojson_zm_02', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[1,2,3,4],[2,3,4,5]]}'));
 
-SELECT 'geomfromgeojson_srs_1', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[100.0,0.0]},{"type":"LineString","coordinates":[[101.0,0.0],[102.0,1.0]]}],"crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}}}'));
-SELECT 'geomfromgeojson_srs_2', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[100.0,0.0]},{"type":"LineString","coordinates":[[101.0,0.0],[102.0,1.0]]}],"crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'));
-SELECT 'geomfromgeojson_srs_3', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[100.0,0.0]},{"type":"LineString","coordinates":[[101.0,0.0],[102.0,1.0]]}],"crs":{"type":"name","props":{"name":"urn:ogc:def:crs:EPSG::4326"}}}'));
-SELECT 'geomfromgeojson_srs_4', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[100.0,0.0]},{"type":"LineString","coordinates":[[101.0,0.0],[102.0,1.0]]}],"crs":{"type":"name","properties":{"nm":"EPSG:4326"}}}'));
+-- correct srs
+SELECT 'geomfromgeojson_srs_1', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[100.0,0.0]},{"type":"LineString","coordinates":[[101.0,0.0],[102.0,1.0]]}],"crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::3395"}}}'));
+SELECT 'geomfromgeojson_srs_2', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[100.0,0.0]},{"type":"LineString","coordinates":[[101.0,0.0],[102.0,1.0]]}],"crs":{"type":"name","properties":{"name":"EPSG:3395"}}}'));
+-- bad srs
+SELECT 'geomfromgeojson_srs_3', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[100.0,0.0]},{"type":"LineString","coordinates":[[101.0,0.0],[102.0,1.0]]}],"crs":{"type":"name","props":{"name":"urn:ogc:def:crs:EPSG::3395"}}}'));
+SELECT 'geomfromgeojson_srs_4', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[100.0,0.0]},{"type":"LineString","coordinates":[[101.0,0.0],[102.0,1.0]]}],"crs":{"type":"name","properties":{"nm":"EPSG:3395"}}}'));
 
 SELECT '#3583', ST_AsText(ST_GeomFromGeoJSON('{"type":"MultiPolygon", "coordinates":[[[139.10030364990232,35.16777444430609],5842.4224490305424]]}'));
 SELECT '#4164', ST_AsText(ST_GeomFromGeoJSON('{"type": "Polygon", "coordinates": [[0,0],[0,5],[5, 5],[5,0],[0,0]]}'));

Modified: trunk/regress/core/in_geojson_expected
===================================================================
--- trunk/regress/core/in_geojson_expected	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/in_geojson_expected	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,4 +1,4 @@
-geomfromgeojson_01|MULTIPOINT(1 1,1 1)
+geomfromgeojson_01|SRID=3005;MULTIPOINT(1 1,1 1)
 geomfromgeojson_02|MULTIPOINT(1 1,1 1)
 geomfromgeojson_03|POINT(1 1)
 geomfromgeojson_04|LINESTRING(0 0,1 1)
@@ -6,6 +6,7 @@
 geomfromgeojson_06|MULTIPOLYGON(((0 0,1 1,1 0,0 0)))
 geomfromgeojson_07|MULTIPOLYGON(((0 0,1 1,1 0,0 0)))
 geomfromgeojson_08|MULTIPOLYGON(((0 0,1 1,1 0,0 0)))
+ERROR:  Only lon/lat coordinate systems are supported in geography. at character 71
 #1434: Next two errors
 ERROR:  Unable to find 'coordinates' in GeoJSON string
 ERROR:  unexpected character (at offset 0)
@@ -21,14 +22,14 @@
 #2619|MULTIPOLYGON EMPTY
 ERROR:  The 'coordinates' in GeoJSON ring are not an array
 ERROR:  The 'coordinates' in GeoJSON ring are not an array
-geomfromgeojson_z_01|POINT(1 2 3)
-geomfromgeojson_z_02|LINESTRING(1 2 3,2 3 4)
-geomfromgeojson_zm_01|POINT(1 2 3)
-geomfromgeojson_zm_02|LINESTRING(1 2 3,2 3 4)
-geomfromgeojson_srs_1|GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
-geomfromgeojson_srs_2|GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
-geomfromgeojson_srs_3|GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
-geomfromgeojson_srs_4|GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
+geomfromgeojson_z_01|SRID=4326;POINT(1 2 3)
+geomfromgeojson_z_02|SRID=4326;LINESTRING(1 2 3,2 3 4)
+geomfromgeojson_zm_01|SRID=4326;POINT(1 2 3)
+geomfromgeojson_zm_02|SRID=4326;LINESTRING(1 2 3,2 3 4)
+geomfromgeojson_srs_1|SRID=3395;GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
+geomfromgeojson_srs_2|SRID=3395;GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
+geomfromgeojson_srs_3|SRID=4326;GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
+geomfromgeojson_srs_4|SRID=4326;GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
 ERROR:  The 'coordinates' in GeoJSON are not sufficiently nested
 ERROR:  The 'coordinates' in GeoJSON are not sufficiently nested
 #4470.a|POLYGON((0 0))

Modified: trunk/regress/core/in_gml.sql
===================================================================
--- trunk/regress/core/in_gml.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/in_gml.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -3,19 +3,6 @@
 -- Written by Olivier Courtin - Oslandia
 --
 
---
--- spatial_ref_sys datas
---
-
--- EPSG 4326 : WGS 84
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (4326,'EPSG',4326,'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
-
---- EPSG 27562 : NTF (Paris) / Lambert Centre France
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (27562,'EPSG',27562,'PROJCS["NTF (Paris) / Lambert Centre France",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise_Paris",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.4660212936265,AUTHORITY["EPSG","7011"]],TOWGS84[-168,-60,320,0,0,0,0],AUTHORITY["EPSG","6807"]],PRIMEM["Paris",2.33722917,AUTHORITY["EPSG","8903"]],UNIT["grad",0.01570796326794897,AUTHORITY["EPSG","9105"]],AUTHORITY["EPSG","4807"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",52],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.99987742],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],AUTHORITY["EPSG","27562"],AXIS["X",EAST],AXIS["Y",NORTH]]','+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ');
-
---- EPSG 27582 : NTF (Paris) / France II (deprecated)
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (27582,'EPSG',27582,'PROJCS["NTF (Paris) / France II (deprecated)",GEOGCS["NTF (Paris)",DATUM["Nouvelle_Triangulation_Francaise_Paris",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.4660212936265,AUTHORITY["EPSG","7011"]],TOWGS84[-168,-60,320,0,0,0,0],AUTHORITY["EPSG","6807"]],PRIMEM["Paris",2.33722917,AUTHORITY["EPSG","8903"]],UNIT["grad",0.01570796326794897,AUTHORITY["EPSG","9105"]],AUTHORITY["EPSG","4807"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",52],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.99987742],PARAMETER["false_easting",600000],PARAMETER["false_northing",2200000],AUTHORITY["EPSG","27582"],AXIS["X",EAST],AXIS["Y",NORTH]]','+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs ');
-
 -- Empty Geometry
 SELECT 'empty_geom', ST_AsEWKT(ST_GeomFromGML(NULL));
 
@@ -1260,10 +1247,3 @@
 
 -- ERROR: Junk
 SELECT 'double_31', ST_AsEWKT(ST_GeomFromGML('<gml:Point><gml:pos>1 $0%@#$^%#</gml:pos></gml:Point>'));
-
---
--- Delete inserted spatial data
---
-DELETE FROM spatial_ref_sys WHERE srid = 4326;
-DELETE FROM spatial_ref_sys WHERE srid = 27562;
-DELETE FROM spatial_ref_sys WHERE srid = 27582;

Modified: trunk/regress/core/in_kml.sql
===================================================================
--- trunk/regress/core/in_kml.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/in_kml.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -2,14 +2,6 @@
 -- GeomFromKML regression test
 -- Written by Olivier Courtin - Oslandia
 --
-
---
--- spatial_ref_sys datas
---
-
--- EPSG 4326 : WGS 84
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (4326,'EPSG',4326,'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
-
 -- Empty Geometry
 SELECT 'empty_geom', ST_AsEWKT(ST_GeomFromKML(NULL));
 
@@ -328,8 +320,3 @@
 -- ERROR: mixed coordinate dimension
 SELECT 'mixed_dims_1', ST_AsEWKT(ST_GeomFromKML('<kml:Point><kml:coordinates>1,2 1,2,3</kml:coordinates></kml:Point>'));
 SELECT 'mixed_dims_2', ST_AsEWKT(ST_GeomFromKML('<kml:Point><kml:coordinates>1,2,3 1,2</kml:coordinates></kml:Point>'));
-
---
--- Delete inserted spatial data
---
-DELETE FROM spatial_ref_sys WHERE srid = 4326;

Modified: trunk/regress/core/knn_recheck.sql
===================================================================
--- trunk/regress/core/knn_recheck.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/knn_recheck.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -65,10 +65,6 @@
 
 DROP TABLE knn_recheck_geom;
 
--- geography tests
-DELETE FROM spatial_ref_sys where srid = 4326;
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","proj4text")
-    VALUES (4326,'EPSG',4326,'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
 -- create table
 CREATE TABLE knn_recheck_geog(gid serial primary key, geog geography);
 INSERT INTO knn_recheck_geog(gid,geog)
@@ -130,11 +126,6 @@
 
 DROP TABLE knn_recheck_geog;
 
---
--- Delete inserted spatial data
---
-DELETE FROM spatial_ref_sys WHERE srid = 4326;
-
 --now the nd operator tests
 -- create table and load
 CREATE TABLE knn_recheck_geom_nd(gid serial primary key, geom geometry);

Modified: trunk/regress/core/legacy.sql
===================================================================
--- trunk/regress/core/legacy.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/legacy.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -11,9 +11,6 @@
 \cd :scriptdir
 \i legacy.sql
 
-TRUNCATE spatial_ref_sys;
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (4326,'EPSG',4326,'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
-
 SELECT 'Starting up MapServer/Geoserver tests...';
 -- Set up the data table
 SELECT 'Setting up the data table...';
@@ -54,6 +51,4 @@
 -- test #1869 ST_AsBinary is not unique --
 SELECT 1869 As ticket_id, ST_AsText(ST_AsBinary('POINT(1 2)'));
 
-DELETE FROM spatial_ref_sys WHERE SRID = '4326';
-
 \i uninstall_legacy.sql

Modified: trunk/regress/core/out_geography.sql
===================================================================
--- trunk/regress/core/out_geography.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/out_geography.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,15 +1,4 @@
-
 --
--- spatial_ref_sys data
---
-
-TRUNCATE spatial_ref_sys;
-
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","proj4text") VALUES (4326,'EPSG',4326,'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
-
-INSERT INTO "spatial_ref_sys" ("srid", "proj4text") VALUES (102189, '+proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666666667 +k=1.000000 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs ');
-
---
 -- GML
 --
 
@@ -64,9 +53,7 @@
 SELECT 'kml_precision_01', ST_AsKML(geography(ST_GeomFromEWKT('SRID=4326;POINT(1.1111111 1.1111111)')), -2);
 SELECT 'kml_precision_02', ST_AsKML(geography(ST_GeomFromEWKT('SRID=4326;POINT(1.1111111 1.1111111)')), 19);
 
--- Projected
--- National Astronomical Observatory of Colombia - Bogota, Colombia (Placemark)
-SELECT 'kml_projection_01', ST_AsKML(geography(ST_GeomFromEWKT('SRID=102189;POINT(1000000 1000000)')), 3);
+-- Projected -- there's no projected geography
 
 --
 -- SVG
@@ -135,9 +122,3 @@
 -- Precision
 SELECT 'text_precision_01', ST_AsText(geography(GeomFromEWKT('SRID=4326;POINT(111.1111111 1.1111111)')));
 SELECT 'text_precision_02', ST_AsText(geography(GeomFromEWKT('SRID=4326;POINT(111.1111111 1.1111111)')),2);
-
-
---
--- Delete inserted spatial data
---
-DELETE FROM spatial_ref_sys;

Modified: trunk/regress/core/out_geography_expected
===================================================================
--- trunk/regress/core/out_geography_expected	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/out_geography_expected	2019-08-06 19:15:24 UTC (rev 17678)
@@ -25,7 +25,6 @@
 kml_empty_geom|
 kml_precision_01|<Point><coordinates>1,1</coordinates></Point>
 kml_precision_02|<Point><coordinates>1.1111111,1.1111111</coordinates></Point>
-ERROR:  Only lon/lat coordinate systems are supported in geography.
 svg_empty_geom|
 svg_option_01|M 1 -1 L 4 -4 5 -7
 svg_option_02|M 1 -1 l 3 -3 1 -3

Modified: trunk/regress/core/out_geometry.sql
===================================================================
--- trunk/regress/core/out_geometry.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/out_geometry.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,13 +1,4 @@
 --
--- spatial_ref_sys data
---
-DELETE FROM "spatial_ref_sys";
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","proj4text") VALUES (4326,'EPSG',4326,'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
-
---- EPSG 1021892 : Bogota 1975 / Colombia Bogota zone (deprecated)
-INSERT INTO "spatial_ref_sys" ("srid", "proj4text") VALUES (102189, '+proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666666667 +k=1.000000 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m +no_defs ');
-
---
 -- GML
 --
 
@@ -81,7 +72,7 @@
 
 -- Projected
 -- National Astronomical Observatory of Colombia - Bogota, Colombia (Placemark)
-SELECT 'kml_projection_01', ST_AsKML(ST_GeomFromEWKT('SRID=102189;POINT(1000000 1000000)'), 3);
+SELECT 'kml_projection_01', ST_AsKML(ST_GeomFromEWKT('SRID=3116;POINT(1000000 1000000)'), 3);
 
 --
 -- Encoded Polyline
@@ -129,6 +120,7 @@
 SELECT 'geojson_crs_04', ST_AsGeoJSON(ST_GeomFromEWKT('SRID=0;POINT(1 1)'), 0, 4);
 SELECT 'geojson_crs_05', ST_AsGeoJSON(ST_GeomFromEWKT('SRID=1;POINT(1 1)'), 0, 2);
 SELECT 'geojson_crs_06', ST_AsGeoJSON(ST_GeomFromEWKT('SRID=1;POINT(1 1)'), 0, 4);
+SELECT 'geojson_crs_07', ST_AsGeoJSON(ST_GeomFromEWKT('SRID=3005;POINT(1 1)'));
 
 -- Bbox
 SELECT 'geojson_bbox_01', ST_AsGeoJSON(ST_GeomFromEWKT('LINESTRING(1 1, 2 2, 3 3, 4 4)'), 0);
@@ -174,9 +166,3 @@
 -- Precision
 SELECT 'text_precision_01', ST_AsText(GeomFromEWKT('SRID=4326;POINT(111.1111111 1.1111111)'));
 SELECT 'text_precision_02', ST_AsText(GeomFromEWKT('SRID=4326;POINT(111.1111111 1.1111111)'),2);
-
-
---
--- Delete inserted spatial data
---
-DELETE FROM spatial_ref_sys;

Modified: trunk/regress/core/out_geometry_expected
===================================================================
--- trunk/regress/core/out_geometry_expected	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/out_geometry_expected	2019-08-06 19:15:24 UTC (rev 17678)
@@ -60,6 +60,7 @@
 geojson_crs_04|{"type":"Point","coordinates":[1,1]}
 ERROR:  SRID 1 unknown in spatial_ref_sys table
 ERROR:  SRID 1 unknown in spatial_ref_sys table
+geojson_crs_07|{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:3005"}},"coordinates":[1,1]}
 geojson_bbox_01|{"type":"LineString","coordinates":[[1,1],[2,2],[3,3],[4,4]]}
 geojson_bbox_02|{"type":"LineString","bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]}
 geojson_bbox_03|{"type":"LineString","bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]}

Modified: trunk/regress/core/regress_management.sql
===================================================================
--- trunk/regress/core/regress_management.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/regress_management.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,8 +1,6 @@
 -- Test the populate_geometry_columns,DropGeometryTable etc --
 \set VERBOSITY terse
 SET client_min_messages TO warning;
-DELETE FROM spatial_ref_sys WHERE srid = 4326;
-INSERT INTO spatial_ref_sys ( srid, proj4text ) VALUES( 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs');
 CREATE TABLE test_pt(gid SERIAL PRIMARY KEY, geom geometry);
 INSERT INTO test_pt(geom) VALUES(ST_GeomFromEWKT('SRID=4326;POINT M(1 2 3)'));
 SELECT populate_geometry_columns('test_pt'::regclass);

Modified: trunk/regress/core/regress_proj.sql
===================================================================
--- trunk/regress/core/regress_proj.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/regress_proj.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -56,14 +56,12 @@
            ST_GeomFromEWKT('SRID=100002;POINT(16 48)'),
            'invalid projection'));
 
-DELETE FROM spatial_ref_sys WHERE srid >= 100000;
+DELETE FROM spatial_ref_sys WHERE srid in (100001, 100002);
 
 --- Overflow proj cache
-TRUNCATE spatial_ref_sys;
-\i ../../spatial_ref_sys.sql
 SELECT 13, count(*) FROM
 (
     SELECT ST_Transform('SRID=4326; POINT(0 0)'::geometry, srid) AS g
     FROM
         ( SELECT srid FROM spatial_ref_sys LIMIT 150 ) _a
-) _b WHERE g IS NOT NULL;
\ No newline at end of file
+) _b WHERE g IS NOT NULL;

Modified: trunk/regress/core/tickets.sql
===================================================================
--- trunk/regress/core/tickets.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/core/tickets.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -3,18 +3,7 @@
 -- referenced by bug number for historical interest.
 --
 SET client_min_messages TO NOTICE;
--- NOTE: some tests _require_ spatial_ref_sys entries.
--- In particular, the GML output ones want auth_name and auth_srid too,
--- so we provide one for EPSG:4326
-DELETE FROM spatial_ref_sys;
-INSERT INTO spatial_ref_sys ( srid, proj4text ) VALUES ( 32611, '+proj=utm +zone=11 +ellps=WGS84 +datum=WGS84 +units=m +no_defs' );
-INSERT INTO spatial_ref_sys ( auth_name, auth_srid, srid, proj4text ) VALUES ( 'EPSG', 4326, 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' );
-INSERT INTO spatial_ref_sys ( srid, proj4text ) VALUES ( 32602, '+proj=utm +zone=2 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ' );
-INSERT INTO spatial_ref_sys ( srid, proj4text ) VALUES ( 32702, '+proj=utm +zone=2 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ' );
-INSERT INTO spatial_ref_sys ( srid, proj4text ) VALUES ( 3395, '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ' );
 
-INSERT INTO spatial_ref_sys (srid,proj4text) VALUES (32707,'+proj=utm +zone=7 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs ');
-
 -- #2 --
 SELECT '#2', ST_AsText(ST_Union(g)) FROM
 ( VALUES
@@ -569,6 +558,7 @@
 insert into spatial_ref_sys (srid, proj4text) values (500001,NULL);
 insert into spatial_ref_sys (srid, proj4text) values (500002, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs');
 select '#1150', st_astext(st_transform('SRID=500002;POINT(0 0)'::geometry,500001));
+delete from spatial_ref_sys where srid in (500001,500002);
 
 -- #1038
 select '#1038', ST_AsSVG('POLYGON EMPTY'::geometry);
@@ -1239,10 +1229,6 @@
 SELECT '#4304a', ST_3DMakeBox(ST_GeomFromText('POINT EMPTY',4326), ST_GeomFromText('POINT EMPTY',4326)) IS NULL;
 SELECT '#4304b', ST_MakeBox2D(ST_GeomFromText('POINT EMPTY',4326), ST_GeomFromText('POINT EMPTY',4326)) IS NULL;
 
-
--- Clean up
-DELETE FROM spatial_ref_sys;
-
 SELECT '#4176', ST_Intersects('POLYGON((0 0, 10 10, 3 5, 0 0))', 'GEOMETRYCOLLECTION(POINT(10 10), LINESTRING(0 0, 3 3))');
 
 with mj as (select 'POINT(0 0)'::geometry geom) select '#4394' from mj a full join mj b on a.geom = b.geom;

Modified: trunk/regress/loader/ReprojectPts-post.sql
===================================================================
--- trunk/regress/loader/ReprojectPts-post.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/loader/ReprojectPts-post.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,2 +0,0 @@
--- Cleanup
-DELETE FROM spatial_ref_sys;

Modified: trunk/regress/loader/ReprojectPts-pre.sql
===================================================================
--- trunk/regress/loader/ReprojectPts-pre.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/loader/ReprojectPts-pre.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,11 +0,0 @@
---- In case this test is running in an extension context
-TRUNCATE spatial_ref_sys;
----
---- EPSG 4326 : WGS 84
----
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (4326,'EPSG',4326,'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
----
---- EPSG 2260 : NAD83 / New York East (ftUS)
----
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (2260,'EPSG',2260,'PROJCS["NAD83 / New York East (ftUS)",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["US survey foot",0.3048006096012192,AUTHORITY["EPSG","9003"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38.83333333333334],PARAMETER["central_meridian",-74.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",492125],PARAMETER["false_northing",0],AUTHORITY["EPSG","2260"],AXIS["X",EAST],AXIS["Y",NORTH]]','+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs ');
-

Modified: trunk/regress/loader/ReprojectPtsD-post.sql
===================================================================
--- trunk/regress/loader/ReprojectPtsD-post.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/loader/ReprojectPtsD-post.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,2 +0,0 @@
--- Cleanup
-DELETE FROM spatial_ref_sys;

Modified: trunk/regress/loader/ReprojectPtsD-pre.sql
===================================================================
--- trunk/regress/loader/ReprojectPtsD-pre.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/loader/ReprojectPtsD-pre.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,11 +0,0 @@
---- In case this test is running in an extension context
-TRUNCATE spatial_ref_sys;
----
---- EPSG 4326 : WGS 84
----
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (4326,'EPSG',4326,'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
----
---- EPSG 2260 : NAD83 / New York East (ftUS)
----
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (2260,'EPSG',2260,'PROJCS["NAD83 / New York East (ftUS)",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["US survey foot",0.3048006096012192,AUTHORITY["EPSG","9003"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38.83333333333334],PARAMETER["central_meridian",-74.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",492125],PARAMETER["false_northing",0],AUTHORITY["EPSG","2260"],AXIS["X",EAST],AXIS["Y",NORTH]]','+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs ');
-

Modified: trunk/regress/loader/ReprojectPtsGeog-post.sql
===================================================================
--- trunk/regress/loader/ReprojectPtsGeog-post.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/loader/ReprojectPtsGeog-post.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,2 +0,0 @@
--- cleanup
-DELETE FROM spatial_ref_sys;

Modified: trunk/regress/loader/ReprojectPtsGeog-pre.sql
===================================================================
--- trunk/regress/loader/ReprojectPtsGeog-pre.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/loader/ReprojectPtsGeog-pre.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,9 +0,0 @@
----
---- EPSG 4326 : WGS 84
----
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (4326,'EPSG',4326,'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
----
---- EPSG 2260 : NAD83 / New York East (ftUS)
----
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (2260,'EPSG',2260,'PROJCS["NAD83 / New York East (ftUS)",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["US survey foot",0.3048006096012192,AUTHORITY["EPSG","9003"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38.83333333333334],PARAMETER["central_meridian",-74.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",492125],PARAMETER["false_northing",0],AUTHORITY["EPSG","2260"],AXIS["X",EAST],AXIS["Y",NORTH]]','+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs ');
-

Modified: trunk/regress/loader/ReprojectPtsGeogD-post.sql
===================================================================
--- trunk/regress/loader/ReprojectPtsGeogD-post.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/loader/ReprojectPtsGeogD-post.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,2 +0,0 @@
--- cleanup
-DELETE FROM spatial_ref_sys;

Modified: trunk/regress/loader/ReprojectPtsGeogD-pre.sql
===================================================================
--- trunk/regress/loader/ReprojectPtsGeogD-pre.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/loader/ReprojectPtsGeogD-pre.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,9 +0,0 @@
----
---- EPSG 4326 : WGS 84
----
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (4326,'EPSG',4326,'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
----
---- EPSG 2260 : NAD83 / New York East (ftUS)
----
-INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (2260,'EPSG',2260,'PROJCS["NAD83 / New York East (ftUS)",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["US survey foot",0.3048006096012192,AUTHORITY["EPSG","9003"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38.83333333333334],PARAMETER["central_meridian",-74.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",492125],PARAMETER["false_northing",0],AUTHORITY["EPSG","2260"],AXIS["X",EAST],AXIS["Y",NORTH]]','+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs ');
-

Modified: trunk/regress/run_test.pl
===================================================================
--- trunk/regress/run_test.pl	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/regress/run_test.pl	2019-08-06 19:15:24 UTC (rev 17678)
@@ -396,10 +396,14 @@
 
 foreach $TEST (@ARGV)
 {
+	my $TEST_OBJ_COUNT_PRE;
+	my $TEST_OBJ_COUNT_POST;
+
 	# catch a common mistake (strip trailing .sql)
 	$TEST =~ s/.sql$//;
 
 	start_test($TEST);
+	$TEST_OBJ_COUNT_PRE = count_postgis_objects();
 
 	# Check for a "-pre.pl" file in case there are setup commands
     eval_file("${TEST}-pre.pl");
@@ -454,6 +458,14 @@
 	# Check for a "-post.pl" file in case there are teardown commands
     eval_file("${TEST}-post.pl");
 
+	$TEST_OBJ_COUNT_POST = count_postgis_objects();
+
+	if ( $TEST_OBJ_COUNT_POST != $TEST_OBJ_COUNT_PRE )
+	{
+		fail("PostGIS object count pre-test ($TEST_OBJ_COUNT_POST) != post-test ($TEST_OBJ_COUNT_PRE)");
+		return 0;
+	}
+
 }
 
 
@@ -1203,7 +1215,8 @@
 		select count(*) from pg_opclass union all
 		select count(*) from pg_namespace
 			where nspname NOT LIKE 'pg_%' union all
-		select count(*) from pg_opfamily )
+		select count(*) from pg_opfamily
+		)
 		select sum(count) from counts");
 
  	return $count;
@@ -1211,6 +1224,21 @@
 
 
 ##################################################################
+# Count postgis objects
+##################################################################
+sub count_postgis_objects
+{
+	my $count = sql("WITH counts as (
+		select count(*) from spatial_ref_sys
+		)
+		select sum(count) from counts");
+
+ 	return $count;
+}
+
+
+
+##################################################################
 # Create the spatial database
 ##################################################################
 sub create_db
@@ -1366,6 +1394,7 @@
 	load_sql_file("${STAGED_SCRIPTS_DIR}/postgis.sql", 1);
 	load_sql_file("${STAGED_SCRIPTS_DIR}/postgis_comments.sql", 0);
 	load_sql_file("${STAGED_SCRIPTS_DIR}/postgis_proc_set_search_path.sql", 0);
+	load_sql_file("${STAGED_SCRIPTS_DIR}/spatial_ref_sys.sql", 0);
 
 	if ( $OPT_WITH_TOPO )
 	{

Modified: trunk/topology/test/regress/copytopology.sql
===================================================================
--- trunk/topology/test/regress/copytopology.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/topology/test/regress/copytopology.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,6 +1,5 @@
 set client_min_messages to WARNING;
 
-INSERT INTO spatial_ref_sys ( auth_name, auth_srid, srid, proj4text ) VALUES ( 'EPSG', 4326, 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' );
 \i load_topology-4326.sql
 \i load_features.sql
 \i more_features.sql
@@ -56,5 +55,3 @@
 select '#2184.2', st_addisonode('t3d', NULL, 'POINT(1 2 3)');
 select '#2184.3', topology.copyTopology('t3d', 't3d-bis') > 0;
 select '#2184.4', length(topology.dropTopology('t3d')) > 0, length(topology.dropTopology('t3d-bis')) > 0;
-
-DELETE FROM spatial_ref_sys where srid = 4326;

Modified: trunk/topology/test/regress/gml.sql
===================================================================
--- trunk/topology/test/regress/gml.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/topology/test/regress/gml.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,7 +1,5 @@
 set client_min_messages to WARNING;
 
-INSERT INTO spatial_ref_sys ( auth_name, auth_srid, srid, proj4text ) VALUES ( 'EPSG', 4326, 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' );
-
 \i load_topology-4326.sql
 \i load_features.sql
 \i more_features.sql
@@ -218,5 +216,4 @@
 
 SELECT topology.DropTopology('city_data');
 DROP SCHEMA features CASCADE;
-DELETE FROM spatial_ref_sys where srid = 4326;
 DROP TABLE visited;

Modified: trunk/topology/test/regress/st_createtopogeo.sql
===================================================================
--- trunk/topology/test/regress/st_createtopogeo.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/topology/test/regress/st_createtopogeo.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,9 +1,6 @@
 \set VERBOSITY terse
 set client_min_messages to ERROR;
 
-TRUNCATE spatial_ref_sys;
-INSERT INTO spatial_ref_sys ( auth_name, auth_srid, srid, proj4text ) VALUES ( 'EPSG', 4326, 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' );
-
 -- Invalid topologies
 select topology.st_createtopogeo('', 'GEOMETRYCOLLECTION(POINT(0 0))');
 select topology.st_createtopogeo('t', 'GEOMETRYCOLLECTION(POINT(0 0))');
@@ -248,6 +245,5 @@
 select null from ( select topology.DropTopology('t') ) as dt;
 
 -- clean up
-DELETE FROM spatial_ref_sys where srid = 4326;
 DROP FUNCTION print_isolated_nodes(text);
 DROP FUNCTION print_elements_count(text);

Modified: trunk/topology/test/regress/st_modedgesplit.sql
===================================================================
--- trunk/topology/test/regress/st_modedgesplit.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/topology/test/regress/st_modedgesplit.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -2,8 +2,6 @@
 \set VERBOSITY terse
 set client_min_messages to WARNING;
 
-INSERT INTO spatial_ref_sys ( auth_name, auth_srid, srid, proj4text ) VALUES ( 'EPSG', 4326, 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' );
-
 -- Import city_data
 \i load_topology-4326.sql
 
@@ -145,7 +143,6 @@
 
 DROP FUNCTION check_changes();
 SELECT DropTopology('city_data');
-DELETE FROM spatial_ref_sys where srid = 4326;
 
 -- See https://trac.osgeo.org/postgis/ticket/3401
 SELECT 't3401.start', CreateTopology('bug3401') > 1;

Modified: trunk/topology/test/regress/st_newedgessplit.sql
===================================================================
--- trunk/topology/test/regress/st_newedgessplit.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/topology/test/regress/st_newedgessplit.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -2,8 +2,6 @@
 \set VERBOSITY terse
 set client_min_messages to ERROR;
 
-INSERT INTO spatial_ref_sys ( auth_name, auth_srid, srid, proj4text ) VALUES ( 'EPSG', 4326, 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' );
-
 -- Import city_data
 \i load_topology-4326.sql
 
@@ -145,4 +143,3 @@
 
 DROP FUNCTION check_changes();
 SELECT DropTopology('city_data');
-DELETE FROM spatial_ref_sys where srid = 4326;

Modified: trunk/topology/test/regress/st_remedgemodface.sql
===================================================================
--- trunk/topology/test/regress/st_remedgemodface.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/topology/test/regress/st_remedgemodface.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,8 +1,6 @@
 \set VERBOSITY terse
 set client_min_messages to ERROR;
 
-INSERT INTO spatial_ref_sys ( auth_name, auth_srid, srid, proj4text ) VALUES ( 'EPSG', 4326, 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' );
-
 -- Import city_data
 \i load_topology-4326.sql
 
@@ -424,5 +422,3 @@
 DROP FUNCTION save_nodes();
 DROP FUNCTION check_nodes(text);
 DROP FUNCTION catch_error(text);
-DELETE FROM spatial_ref_sys where srid = 4326;
-

Modified: trunk/topology/test/regress/st_remedgenewface.sql
===================================================================
--- trunk/topology/test/regress/st_remedgenewface.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/topology/test/regress/st_remedgenewface.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,8 +1,6 @@
 \set VERBOSITY terse
 set client_min_messages to ERROR;
 
-INSERT INTO spatial_ref_sys ( auth_name, auth_srid, srid, proj4text ) VALUES ( 'EPSG', 4326, 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' );
-
 -- Import city_data
 \i load_topology-4326.sql
 
@@ -424,5 +422,3 @@
 DROP FUNCTION save_nodes();
 DROP FUNCTION check_nodes(text);
 DROP FUNCTION catch_error(text);
-DELETE FROM spatial_ref_sys where srid = 4326;
-

Modified: trunk/topology/test/regress/topogeo_addlinestring.sql
===================================================================
--- trunk/topology/test/regress/topogeo_addlinestring.sql	2019-08-06 15:59:22 UTC (rev 17677)
+++ trunk/topology/test/regress/topogeo_addlinestring.sql	2019-08-06 19:15:24 UTC (rev 17678)
@@ -1,8 +1,6 @@
 \set VERBOSITY terse
 set client_min_messages to ERROR;
 
-INSERT INTO spatial_ref_sys ( auth_name, auth_srid, srid, proj4text ) VALUES ( 'EPSG', 4326, 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' );
-
 \i load_topology-4326.sql
 
 -- Save max node id
@@ -262,7 +260,6 @@
 -- Cleanups
 DROP FUNCTION check_changes(text);
 SELECT DropTopology('city_data');
-DELETE FROM spatial_ref_sys where srid = 4326;
 
 -- See http://trac.osgeo.org/postgis/ticket/3280
 SELECT 't3280.start', topology.CreateTopology('bug3280') > 0;



More information about the postgis-tickets mailing list