[SCM] PostGIS branch master updated. 3.5.0alpha2-11-g0341df452

git at osgeo.org git at osgeo.org
Tue Jul 16 19:38:55 PDT 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  0341df45280423f0fa51b16b7249b7847b68834b (commit)
      from  0f854e67efdef544e621514237fc453ffbd943ab (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 0341df45280423f0fa51b16b7249b7847b68834b
Author: Daniel Baston <dbaston at gmail.com>
Date:   Wed Jun 19 09:31:34 2024 -0400

    ST_Length: Return 0 for CurvePolygon
    
    Fixes https://trac.osgeo.org/postgis/ticket/5747

diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c
index 5a3125553..d22af5ea1 100644
--- a/liblwgeom/lwgeom.c
+++ b/liblwgeom/lwgeom.c
@@ -2044,7 +2044,7 @@ double lwgeom_length_2d(const LWGEOM *geom)
 		return lwcircstring_length_2d((LWCIRCSTRING*)geom);
 	else if ( type == COMPOUNDTYPE )
 		return lwcompound_length_2d((LWCOMPOUND*)geom);
-	else if ( lwgeom_is_collection(geom) )
+	else if ( type != CURVEPOLYTYPE && lwgeom_is_collection(geom) )
 	{
 		double length = 0.0;
 		uint32_t i;
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index ad900d80a..1889acdd9 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1555,3 +1555,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);
+
+SELECT '#5747', ST_Length('MULTISURFACE (((0 0, 1 0, 1 1, 0 1, 0 0)), CURVEPOLYGON (CIRCULARSTRING (10 10, 11 11, 12 10, 11 9, 10 10)))'::geometry);
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index 5f8ff612c..f2ebc6e25 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -480,3 +480,4 @@ ERROR:  Geometry contains invalid coordinates
 #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
+#5747|0

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

Summary of changes:
 liblwgeom/lwgeom.c            | 2 +-
 regress/core/tickets.sql      | 2 ++
 regress/core/tickets_expected | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list