[SCM] PostGIS branch master updated. 3.4.0rc1-974-g376d4ec7c

git at osgeo.org git at osgeo.org
Tue Mar 5 13:49:32 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, master has been updated
       via  376d4ec7caf5b3772a8615f7b44b880bf4942ef8 (commit)
      from  e691c963fdc83d36e5e18a4e7aca912867893759 (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 376d4ec7caf5b3772a8615f7b44b880bf4942ef8
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Mar 5 13:49:28 2024 -0800

    ST_NumInteriorRings for Triangle, references #5686

diff --git a/postgis/lwgeom_ogc.c b/postgis/lwgeom_ogc.c
index d4458462a..33ad57c8f 100644
--- a/postgis/lwgeom_ogc.c
+++ b/postgis/lwgeom_ogc.c
@@ -420,7 +420,7 @@ Datum LWGEOM_numinteriorrings_polygon(PG_FUNCTION_ARGS)
 	if ( !lwgeom_has_rings(lwgeom) )
 		PG_RETURN_NULL();
 
-	if ( lwgeom_is_empty(lwgeom) )
+	if ( lwgeom_is_empty(lwgeom) || type == TRIANGLETYPE )
 		PG_RETURN_INT32(0);
 
 	/*
@@ -428,7 +428,7 @@ Datum LWGEOM_numinteriorrings_polygon(PG_FUNCTION_ARGS)
 	 * with an array of nrings rings of POINTARRAY holding the
 	 * rings
 	 */
-	if (type == POLYGONTYPE || type == TRIANGLETYPE)
+	if (type == POLYGONTYPE )
 	{
 		const LWPOLY *poly = lwgeom_as_lwpoly(lwgeom);
 		result = poly->nrings - 1;
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index 3c2bbe0a7..ad900d80a 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1553,3 +1553,5 @@ SELECT '#5677',
      ]
    ))
  );
+
+SELECT '#5686', ST_NumInteriorRings('TRIANGLE (( -71.0821 42.3036, -71.0821 42.3936, -71.0901 42.3036, -71.0821 42.3036))'::geometry);
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index 8d8161c29..5f8ff612c 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -479,3 +479,4 @@ ERROR:  Geometry contains invalid coordinates
 #5639|fullywithin7|t
 #5597|{"type": "Feature", "geometry": null, "properties": {}}
 #5677|POLYGON((0 0,0 10,20 22,20 30,30 30,30 20,22 20,10 0,0 0))
+#5686|0

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

Summary of changes:
 postgis/lwgeom_ogc.c          | 4 ++--
 regress/core/tickets.sql      | 2 ++
 regress/core/tickets_expected | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list