[SCM] PostGIS branch master updated. 3.6.0rc2-285-gc7e5cf9a2

git at osgeo.org git at osgeo.org
Wed Jan 14 23:54:04 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, master has been updated
       via  c7e5cf9a28d1c722da516b87cd033b846212721e (commit)
      from  013e9b0fd9c37f5d03e32231f81b8e8ba2c9f9dd (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 c7e5cf9a28d1c722da516b87cd033b846212721e
Author: Sandro Santilli <strk at kbt.io>
Date:   Thu Jan 15 08:53:36 2026 +0100

    Make ptarray_contains_point wrap ptarray_contains_point_partial

diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c
index cce30d5b2..54cfe875e 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -754,73 +754,8 @@ ptarray_is_closed_z(const POINTARRAY *in)
 int
 ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
 {
-	const POINT2D *seg1, *seg2;
 	int wn = 0;
-
-	seg1 = getPoint2d_cp(pa, 0);
-	seg2 = getPoint2d_cp(pa, pa->npoints-1);
-	if (!p2d_same(seg1, seg2))
-		lwerror("ptarray_contains_point called on unclosed ring");
-
-	for (uint32_t i = 1; i < pa->npoints; i++)
-	{
-		double side, ymin, ymax;
-
-		seg2 = getPoint2d_cp(pa, i);
-
-		/* Zero length segments are ignored. */
-		if (p2d_same(seg1, seg2))
-		{
-			seg1 = seg2;
-			continue;
-		}
-
-		ymin = FP_MIN(seg1->y, seg2->y);
-		ymax = FP_MAX(seg1->y, seg2->y);
-
-		/* Only test segments in our vertical range */
-		if (pt->y > ymax || pt->y < ymin)
-		{
-			seg1 = seg2;
-			continue;
-		}
-
-		side = lw_segment_side(seg1, seg2, pt);
-
-		/*
-		* A point on the boundary of a ring is not contained.
-		* WAS: if (fabs(side) < 1e-12), see #852
-		*/
-		if ((side == 0) && lw_pt_in_seg(pt, seg1, seg2))
-		{
-			return LW_BOUNDARY;
-		}
-
-		/*
-		* If the point is to the left of the line, and it's rising,
-		* then the line is to the right of the point and
-		* circling counter-clockwise, so increment.
-		*/
-		if ((side < 0) && (seg1->y <= pt->y) && (pt->y < seg2->y))
-		{
-			wn++;
-		}
-
-		/*
-		* If the point is to the right of the line, and it's falling,
-		* then the line is to the right of the point and circling
-		* clockwise, so decrement.
-		*/
-		else if ( (side > 0) && (seg2->y <= pt->y) && (pt->y < seg1->y) )
-		{
-			wn--;
-		}
-
-		seg1 = seg2;
-	}
-
-	/* wn == 0 => Outside, wn != 0 => Inside */
-	return wn == 0 ? LW_OUTSIDE : LW_INSIDE;
+	return ptarray_contains_point_partial(pa, pt, LW_TRUE, &wn);
 }
 
 int

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

Summary of changes:
 liblwgeom/ptarray.c | 67 +----------------------------------------------------
 1 file changed, 1 insertion(+), 66 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list