[SCM] PostGIS branch stable-3.5 updated. 3.5.3-65-g17b3a4ac3

git at osgeo.org git at osgeo.org
Mon Oct 6 14:48:51 PDT 2025


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.5 has been updated
       via  17b3a4ac3d1eff3a22eba4bbb88e9f358479d4f1 (commit)
      from  ad84988e23da71ad8dcda1e878641c18f3a1113a (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 17b3a4ac3d1eff3a22eba4bbb88e9f358479d4f1
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Oct 6 14:26:43 2025 -0700

    Fix raycast for linestrings, references #5989

diff --git a/liblwgeom/cunit/cu_measures.c b/liblwgeom/cunit/cu_measures.c
index 58e7cb4ba..c95bf21e1 100644
--- a/liblwgeom/cunit/cu_measures.c
+++ b/liblwgeom/cunit/cu_measures.c
@@ -89,6 +89,14 @@ static void test_mindistance2d_tolerance(void)
 	double zero_accepted_error = 0.0;
 
 
+	/*
+	* CurvePolygon and Point, #5989
+	*/
+	DIST2DTEST(
+		"CURVEPOLYGON(COMPOUNDCURVE((129296 142584,94722 100435,91618 97138,57306 60686,26874 28357,13059 34228,14572 65506,14593 65948,14616 66389),CIRCULARSTRING(14616 66389,17955 101124,24417 135415,24655 136418,24895 137421),(24895 137421,25472 139809,19354 141285,0 0,148000 142000,129296 142584)))",
+		"POINT(19925 112376)",
+		199.655, 0.001);
+
 	/*
 	** Simple case.
 	*/
diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c
index ea59575d3..ad0150e20 100644
--- a/liblwgeom/lwalgorithm.c
+++ b/liblwgeom/lwalgorithm.c
@@ -107,25 +107,11 @@ lw_pt_in_seg(const POINT2D *P, const POINT2D *A1, const POINT2D *A2)
 }
 
 int
-lw_pt_on_segment(const POINT2D* p1, const POINT2D* p2, const POINT2D* p)
+lw_pt_on_segment(const POINT2D* A1, const POINT2D* A2, const POINT2D* P)
 {
-    // Check if the point is within the bounding box of the segment
-    if (p->x < FP_MIN(p1->x, p2->x) || p->x > FP_MAX(p1->x, p2->x) ||
-        p->y < FP_MIN(p1->y, p2->y) || p->y > FP_MAX(p1->y, p2->y))
-    {
-        return LW_FALSE;
-    }
-
-    // Check for collinearity using the 2D cross-product.
-    // (p.y - p1.y) * (p2.x - p1.x) - (p.x - p1.x) * (p2.y - p1.y)
-    double cross_product = (p->y - p1->y) * (p2->x - p1->x) - (p->x - p1->x) * (p2->y - p1->y);
-
-    if (fabs(cross_product) < DBL_EPSILON)
-    {
-        return LW_TRUE; // Point is collinear and within the bounding box
-    }
-
-    return LW_TRUE;
+	int side = lw_segment_side(A1, A2, P);
+	if (side != 0) return LW_FALSE;
+	return lw_pt_in_seg(P, A1, A2);
 }
 
 /**

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

Summary of changes:
 liblwgeom/cunit/cu_measures.c |  8 ++++++++
 liblwgeom/lwalgorithm.c       | 22 ++++------------------
 2 files changed, 12 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list