[SCM] PostGIS branch stable-3.6 updated. 3.6.1-10-g80eefad13

git at osgeo.org git at osgeo.org
Tue Jan 13 07:24:52 PST 2026


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.6 has been updated
       via  80eefad13bd00d1e56d2bec36cd5140f87775ce4 (commit)
      from  f71e8d8a682cfaf72330ae70bdc24c1e1bbd7802 (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 80eefad13bd00d1e56d2bec36cd5140f87775ce4
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Jan 13 12:05:57 2026 +0100

    Fix robustness issue in ptarray_contains_point
    
    References #6023 in 3.6 branch (3.6.2dev)
    
    Includes unit test

diff --git a/liblwgeom/cunit/cu_ptarray.c b/liblwgeom/cunit/cu_ptarray.c
index 99c689ac2..6d8ea2faa 100644
--- a/liblwgeom/cunit/cu_ptarray.c
+++ b/liblwgeom/cunit/cu_ptarray.c
@@ -426,6 +426,17 @@ static void test_ptarray_contains_point()
 	rv = ptarray_contains_point(pa, &pt);
 	CU_ASSERT_EQUAL(rv, LW_INSIDE);
 
+	lwline_free(lwline);
+
+
+	/* Test for https://trac.osgeo.org/postgis/ticket/6023 */
+	lwline = lwgeom_as_lwline(lwgeom_from_text("LINESTRING(11.230120879533454 62.84897119848748,11.230120879533905 62.8489711984873,11.23020501303477 62.84900750109812,11.230170431987244 62.84904481447776,11.230117909393426 62.8489943480894,11.230120879533454 62.84897119848748)"));
+	pa = lwline->points;
+	pt = getPoint2d(lwline->points, 0);
+	rv = ptarray_contains_point(pa, &pt);
+	ASSERT_INT_EQUAL(rv, LW_BOUNDARY);
+
+
 	lwline_free(lwline);
 }
 
diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c
index 2bc6126b5..2afb12c44 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -768,6 +768,12 @@ ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
 
 		seg2 = getPoint2d_cp(pa, i);
 
+		/* This is required for robustness, see #6023 */
+		if (p2d_same(seg1, pt))
+		{
+			return LW_BOUNDARY;
+		}
+
 		/* Zero length segments are ignored. */
 		if (p2d_same(seg1, seg2))
 		{

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

Summary of changes:
 liblwgeom/cunit/cu_ptarray.c | 11 +++++++++++
 liblwgeom/ptarray.c          |  6 ++++++
 2 files changed, 17 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list