[SCM] PostGIS branch stable-3.4 updated. 3.4.4-66-gfdfffdb43
git at osgeo.org
git at osgeo.org
Tue Jan 13 07:33:38 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.4 has been updated
via fdfffdb437bd937aa37c59ca9590d73882779c6e (commit)
from e7b06279475fceb45def9292a2c5d6544d184508 (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 fdfffdb437bd937aa37c59ca9590d73882779c6e
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.4 branch (3.4.5dev)
Includes unit test
diff --git a/NEWS b/NEWS
index a1f1b4576..3d0347ef7 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Proj 6.1+ required.
* Bug Fixes *
+ - #6023, Fix robustness issue in ptarray_contains_point (Sandro Santilli)
- #6027, Fix RemoveUnusedPrimitives without topology in search_path (Sandro Santilli)
- #5978, fix parsing of constraints in geometry_columns (Paul Ramsey)
- #5977, Fix downgrade protection with standard conforming strings off (Sandro Santilli)
diff --git a/liblwgeom/cunit/cu_ptarray.c b/liblwgeom/cunit/cu_ptarray.c
index bfb830284..bb1f43925 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 12114bbf2..74141aefd 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -772,6 +772,12 @@ ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int chec
{
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 ( seg1->x == seg2->x && seg1->y == seg2->y )
{
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
liblwgeom/cunit/cu_ptarray.c | 11 +++++++++++
liblwgeom/ptarray.c | 6 ++++++
3 files changed, 18 insertions(+)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list