[postgis-tickets] r16791 - Add postgis_geos_noop function

Sandro Santilli strk at kbt.io
Fri Sep 14 06:43:53 PDT 2018


Author: strk
Date: 2018-09-14 06:43:52 -0700 (Fri, 14 Sep 2018)
New Revision: 16791

Modified:
   trunk/NEWS
   trunk/postgis/postgis.sql.in
   trunk/regress/lwgeom_regress.sql
   trunk/regress/lwgeom_regress_expected
Log:
Add postgis_geos_noop function

Includes regress test.
Closes #2902

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2018-09-13 21:34:51 UTC (rev 16790)
+++ trunk/NEWS	2018-09-14 13:43:52 UTC (rev 16791)
@@ -3,6 +3,8 @@
 * Breaking Changes *
   - #3888, Raster support now available as a separate extension
     (Sandro Santilli)
+* New Features *
+  - #2902, postgis_geos_noop (Sandro Santilli)
 * Enhancements and fixes *
   - #4153, ST_Segmentize now splits segments proportionally (Darafei
     Praliaskouski).

Modified: trunk/postgis/postgis.sql.in
===================================================================
--- trunk/postgis/postgis.sql.in	2018-09-13 21:34:51 UTC (rev 16790)
+++ trunk/postgis/postgis.sql.in	2018-09-14 13:43:52 UTC (rev 16791)
@@ -1538,6 +1538,13 @@
 	LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL
 	COST 10;
 
+-- Availability: 3.0.0
+CREATE OR REPLACE FUNCTION postgis_geos_noop(geometry)
+	RETURNS geometry
+	AS 'MODULE_PATHNAME', 'GEOSnoop'
+	LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL
+	COST 10;
+
 -- Availability: 2.3.0
 CREATE OR REPLACE FUNCTION ST_Normalize(geom geometry)
 	RETURNS geometry

Modified: trunk/regress/lwgeom_regress.sql
===================================================================
--- trunk/regress/lwgeom_regress.sql	2018-09-13 21:34:51 UTC (rev 16790)
+++ trunk/regress/lwgeom_regress.sql	2018-09-14 13:43:52 UTC (rev 16791)
@@ -110,6 +110,15 @@
 SELECT '#3069',  postgis_getbbox('SRID=0;MULTIPOINT(1 1)'::geometry);
 SELECT '#3069',  postgis_getbbox('SRID=0;MULTILINESTRING((0 0,1 1))'::geometry);
 
+SELECT '#2902', replace(ST_Summary(PostGIS_GEOS_Noop(
+'SRID=4326;
+ GEOMETRYCOLLECTION(
+   POLYGON((0 0 1, 0 1 2, 1 1 3,1 0 2,0 0 1)),
+   POINT(1 2 3),
+   MULTILINESTRING((1 1 3,0 0 9))
+ )'::geometry)),E'\n',' ');
+
+
 -- ST_BoundingDiagonal
 
 SELECT 'BoundingDiagonal1', ST_AsEwkt(ST_BoundingDiagonal(postgis_addbbox(

Modified: trunk/regress/lwgeom_regress_expected
===================================================================
--- trunk/regress/lwgeom_regress_expected	2018-09-13 21:34:51 UTC (rev 16790)
+++ trunk/regress/lwgeom_regress_expected	2018-09-14 13:43:52 UTC (rev 16791)
@@ -15,6 +15,7 @@
 #3069|BOX(0 0,1 1)
 #3069|BOX(1 1,1 1)
 #3069|BOX(0 0,1 1)
+#2902|GeometryCollection[ZBS] with 3 elements   Polygon[ZS] with 1 rings    ring 0 has 5 points   Point[ZS]   MultiLineString[ZS] with 1 elements     LineString[ZS] with 2 points
 BoundingDiagonal1|SRID=4326;LINESTRING(999999986991104 999999986991104,1e+15 1e+15)
 BoundingDiagonal2|SRID=4326;LINESTRING(1e+15 1e+15,1e+15 1e+15)
 BoundingDiagonal3|SRID=4326;LINESTRING(999999986991104 999999986991104,1e+15 1e+15)



More information about the postgis-tickets mailing list