[SCM] PostGIS branch stable-3.3 updated. 3.3.5-17-g444df4771

git at osgeo.org git at osgeo.org
Tue Jan 9 12:46:30 PST 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, stable-3.3 has been updated
       via  444df47713aecd408f76509a783567564d737bd1 (commit)
      from  71aed1cde01ee3b1299c7b4192c34ca9da1c0892 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 444df47713aecd408f76509a783567564d737bd1
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Jan 9 12:46:25 2024 -0800

    Fix logic mistake in ST_Covers for geography

diff --git a/NEWS b/NEWS
index 30cb313f4..2ad750011 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ Proj 6.1+, and PostgreSQL 15+.
  - #5604, Handle distance between collections with empty elements (Paul Ramsey)
  - #5635, Handle NaN points in ST_Split (Regina Obe)
  - #5648, postgis_raster upgrade fails on PG16 (Ronan Dunklau)
+ - Logic error in ST_Covers(geography) (Paul Ramsey)
 
 
 PostGIS 3.3.5
diff --git a/liblwgeom/lwgeodetic.c b/liblwgeom/lwgeodetic.c
index 7d9f43f9b..c2b2f7833 100644
--- a/liblwgeom/lwgeodetic.c
+++ b/liblwgeom/lwgeodetic.c
@@ -2629,23 +2629,10 @@ int lwpoly_covers_lwpoly(const LWPOLY *poly1, const LWPOLY *poly2)
 	/* check if all vertices of poly2 are inside poly1 */
 	for (i = 0; i < poly2->nrings; i++)
 	{
-
-		/* every other ring is a hole, check if point is inside the actual polygon */
-		if ( i % 2 == 0)
+		if (LW_FALSE == lwpoly_covers_pointarray(poly1, poly2->rings[i]))
 		{
-			if (LW_FALSE == lwpoly_covers_pointarray(poly1, poly2->rings[i]))
-			{
-				LWDEBUG(4,"returning false, geometry2 has point outside of geometry1");
-				return LW_FALSE;
-			}
-		}
-		else
-		{
-			if (LW_TRUE == lwpoly_covers_pointarray(poly1, poly2->rings[i]))
-			{
-				LWDEBUG(4,"returning false, geometry2 has point inside a hole of geometry1");
-				return LW_FALSE;
-			}
+			LWDEBUG(4,"returning false, geometry2 has point outside of geometry1");
+			return LW_FALSE;
 		}
 	}
 

-----------------------------------------------------------------------

Summary of changes:
 NEWS                   |  1 +
 liblwgeom/lwgeodetic.c | 19 +++----------------
 2 files changed, 4 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list