[SCM] PostGIS branch stable-3.1 updated. 3.1.10-13-g871d365df

git at osgeo.org git at osgeo.org
Tue Jan 9 12:49:26 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.1 has been updated
       via  871d365dfb421f886490a766a2a212ac9be0a123 (commit)
      from  ac11e3be8c373069113a647344484e745500d56a (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 871d365dfb421f886490a766a2a212ac9be0a123
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Jan 9 12:49:21 2024 -0800

    Fix logic mistake in ST_Covers for geography

diff --git a/NEWS b/NEWS
index b4a02e4f2..5cf2268dd 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ xxxx/xx/xx
  - #5627, Handling of EMPTY components in PiP check (Paul Ramsey)
  - #5604, Handle distance between collections with empty elements (Paul Ramsey)
  - #5635, Handle NaN points in ST_Split (Regina Obe)
+ - Logic error in ST_Covers(geography) (Paul Ramsey)
 
 
 PostGIS 3.1.10
diff --git a/liblwgeom/lwgeodetic.c b/liblwgeom/lwgeodetic.c
index 601928568..1903b8ede 100644
--- a/liblwgeom/lwgeodetic.c
+++ b/liblwgeom/lwgeodetic.c
@@ -2623,23 +2623,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