]> granicus.if.org Git - postgis/commitdiff
ST_Interscts support GEOMETRYCOLLECTION
authorDarafei Praliaskouski <me@komzpa.net>
Thu, 13 Sep 2018 13:29:20 +0000 (13:29 +0000)
committerDarafei Praliaskouski <me@komzpa.net>
Thu, 13 Sep 2018 13:29:20 +0000 (13:29 +0000)
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

git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@16773 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
doc/reference_measure.xml
postgis/lwgeom_geos.c
regress/tickets.sql
regress/tickets_expected

diff --git a/NEWS b/NEWS
index 51679829bfbf0434f0bc7392b03379c9647a809b..f0538681c383d3d3d1e0eaf4884d5e8c568a00ea 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,8 @@ New since PostGIS 2.5.0rc1
     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
index ca7759a66eceb85a55d429f3c5cf950988e971e3..7a1c9be8173971a64f23a82a083e8483c6f96f0d 100644 (file)
@@ -3474,12 +3474,8 @@ FROM test;
                                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>
index 7ad59262ece0649f91f4e79b56f4a8bb7e3718d4..40922beec22ba62462db5744aa833da5e40bfa93 100644 (file)
@@ -2149,7 +2149,6 @@ Datum geos_intersects(PG_FUNCTION_ARGS)
        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 */
index 8c1784e18d692400e6b856dec23d1a5b5f2e879d..7464364d81c4e6139ddb08ccfa7809142a1aafb9 100644 (file)
@@ -1103,3 +1103,5 @@ SELECT ST_AsText(ST_GeomFromGeoJSON('{"type": "Polygon", "coordinates": [[0,0],[
 
 -- 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))');
index 45f44e60217f230809f25132f3adfe45c3a75c13..e721e59be4e3e3c513d83bbaee35bb764a77bb5f 100644 (file)
@@ -336,3 +336,4 @@ ERROR:  lwgeom_union: GEOS Error: TopologyException: Input geom 0 is invalid: Se
 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