[postgis-tickets] r16773 - ST_Interscts support GEOMETRYCOLLECTION

Darafei komzpa at gmail.com
Thu Sep 13 06:29:22 PDT 2018


Author: komzpa
Date: 2018-09-13 06:29:20 -0700 (Thu, 13 Sep 2018)
New Revision: 16773

Modified:
   branches/2.5/NEWS
   branches/2.5/doc/reference_measure.xml
   branches/2.5/postgis/lwgeom_geos.c
   branches/2.5/regress/tickets.sql
   branches/2.5/regress/tickets_expected
Log:
ST_Interscts support GEOMETRYCOLLECTION

By some overlook ST_Intersects has a guard against GEOMETRYCOLLECTION, while GEOS can handle it.

Closes #4176
Closes https://github.com/postgis/postgis/pull/297



Modified: branches/2.5/NEWS
===================================================================
--- branches/2.5/NEWS	2018-09-13 13:25:52 UTC (rev 16772)
+++ branches/2.5/NEWS	2018-09-13 13:29:20 UTC (rev 16773)
@@ -5,7 +5,8 @@
     radius in table (Darafei Praliaskouski, github user Boscop).
   - #4163, MVT: Fix resource leak when the first geometry is NULL (Raúl Marín)
   - #4172, Fix memory leak in lwgeom_offsetcurve (Raúl Marín)
-  - #4146, Parse error on incorrectly nested GeoJSON input (Paul Ramsey)
+  - #4164, Parse error on incorrectly nested GeoJSON input (Paul Ramsey)
+  - #4176, ST_Intersects supports GEOMETRYCOLLECTION (Darafei Praliaskouski)
 
 PostGIS 2.5.0rc1
 2018/08/19

Modified: branches/2.5/doc/reference_measure.xml
===================================================================
--- branches/2.5/doc/reference_measure.xml	2018-09-13 13:25:52 UTC (rev 16772)
+++ branches/2.5/doc/reference_measure.xml	2018-09-13 13:29:20 UTC (rev 16773)
@@ -3474,12 +3474,8 @@
 				returns true, then the geometries also spatially intersect.
 				Disjoint implies false for spatial intersection.</para>
 
-	  <important>
-		<para>Do not call with a <varname>GEOMETRYCOLLECTION</varname> as an argument for geometry version.  The geography
-			version supports GEOMETRYCOLLECTION since its a thin wrapper around distance implementation.</para>
-	  </important>
-	  <para>Enhanced: 2.3.0 Enhancement to PIP short-circuit extended to support MultiPoints with few points. Prior versions only supported point in polygon.</para>
-
+			<para>Enhanced: 2.5.0 Supports GEOMETRYCOLLECTION.</para>
+			<para>Enhanced: 2.3.0 Enhancement to PIP short-circuit extended to support MultiPoints with few points. Prior versions only supported point in polygon.</para>
 			<para>Performed by the GEOS module (for geometry), geography is native</para>
 			<para>Availability: 1.5 support for geography was introduced.</para>
 			<note>

Modified: branches/2.5/postgis/lwgeom_geos.c
===================================================================
--- branches/2.5/postgis/lwgeom_geos.c	2018-09-13 13:25:52 UTC (rev 16772)
+++ branches/2.5/postgis/lwgeom_geos.c	2018-09-13 13:29:20 UTC (rev 16773)
@@ -2149,7 +2149,6 @@
 	geom1 = PG_GETARG_GSERIALIZED_P(0);
 	geom2 = PG_GETARG_GSERIALIZED_P(1);
 
-	errorIfGeometryCollection(geom1,geom2);
 	error_if_srid_mismatch(gserialized_get_srid(geom1), gserialized_get_srid(geom2));
 
 	/* A.Intersects(Empty) == FALSE */

Modified: branches/2.5/regress/tickets.sql
===================================================================
--- branches/2.5/regress/tickets.sql	2018-09-13 13:25:52 UTC (rev 16772)
+++ branches/2.5/regress/tickets.sql	2018-09-13 13:29:20 UTC (rev 16773)
@@ -1103,3 +1103,5 @@
 
 -- 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))');

Modified: branches/2.5/regress/tickets_expected
===================================================================
--- branches/2.5/regress/tickets_expected	2018-09-13 13:25:52 UTC (rev 16772)
+++ branches/2.5/regress/tickets_expected	2018-09-13 13:29:20 UTC (rev 16773)
@@ -336,3 +336,4 @@
 ERROR:  lwgeom_pointonsurface: GEOS Error: TopologyException: Input geom 1 is invalid: Self-intersection
 #4081|f|t
 ERROR:  The 'coordinates' in GeoJSON polygon are not sufficiently nested
+#4176|t



More information about the postgis-tickets mailing list