From 0ca88f047747cbaa9913941191c4ce2763363d9c Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Thu, 13 Sep 2018 13:35:33 +0000 Subject: [PATCH] =?utf8?q?ST=5FInters=D0=B5cts=20support=20GEOMETRYCOLLECT?= =?utf8?q?ION?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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/trunk@16775 b70326c6-7e19-0410-871a-916f4a2858ee --- NEWS | 1 + doc/reference_measure.xml | 8 ++------ postgis/lwgeom_geos.c | 1 - regress/tickets.sql | 2 ++ regress/tickets_expected | 1 + 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 830e93b69..3ea6331ff 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ PostGIS 3.0.0 - #4161, MVT: Drop geometries smaller than the resolution (Raúl Marín) - #4172, Fix memory leak in lwgeom_offsetcurve (Raúl Marín) - #4173, Fix undefined behaviour in ptarray_segmentize2d (Raúl Marín) + - #4176, ST_Intersects supports GEOMETRYCOLLECTION (Darafei Praliaskouski) PostGIS 2.5.0rc1 2018/08/19 diff --git a/doc/reference_measure.xml b/doc/reference_measure.xml index ca7759a66..7a1c9be81 100644 --- a/doc/reference_measure.xml +++ b/doc/reference_measure.xml @@ -3474,12 +3474,8 @@ FROM test; returns true, then the geometries also spatially intersect. Disjoint implies false for spatial intersection. - - Do not call with a GEOMETRYCOLLECTION as an argument for geometry version. The geography - version supports GEOMETRYCOLLECTION since its a thin wrapper around distance implementation. - - Enhanced: 2.3.0 Enhancement to PIP short-circuit extended to support MultiPoints with few points. Prior versions only supported point in polygon. - + Enhanced: 2.5.0 Supports GEOMETRYCOLLECTION. + Enhanced: 2.3.0 Enhancement to PIP short-circuit extended to support MultiPoints with few points. Prior versions only supported point in polygon. Performed by the GEOS module (for geometry), geography is native Availability: 1.5 support for geography was introduced. diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index e618a87c6..2219f89b5 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -2148,7 +2148,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 */ diff --git a/regress/tickets.sql b/regress/tickets.sql index 8c1784e18..7464364d8 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -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))'); diff --git a/regress/tickets_expected b/regress/tickets_expected index 45f44e602..e721e59be 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -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 -- 2.40.0