[SCM] PostGIS branch stable-3.4 updated. 3.4.4-58-gff86b0204
git at osgeo.org
git at osgeo.org
Mon Oct 6 14:48:56 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.4 has been updated
via ff86b0204c253be159154cc718f49bce3c5a8e08 (commit)
via e0b431b6dcf0394da7bad09ee531d6098bdd99d3 (commit)
from ceb807b1c4ebd8c00179707738aad8fc09f490d1 (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 ff86b0204c253be159154cc718f49bce3c5a8e08
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 331d4c14d..cd2295975 100644
--- a/liblwgeom/lwalgorithm.c
+++ b/liblwgeom/lwalgorithm.c
@@ -99,25 +99,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);
}
/**
commit e0b431b6dcf0394da7bad09ee531d6098bdd99d3
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Fri Oct 3 10:08:26 2025 -0700
Pg19 build support
diff --git a/libpgcommon/lwgeom_pg.h b/libpgcommon/lwgeom_pg.h
index 151138a8c..d7706ff52 100644
--- a/libpgcommon/lwgeom_pg.h
+++ b/libpgcommon/lwgeom_pg.h
@@ -88,13 +88,23 @@ void pg_install_lwgeom_handlers(void);
/* Argument handling macros */
#define PG_GETARG_GSERIALIZED_P(varno) ((GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(varno)))
+
#define PG_GETARG_GSERIALIZED_P_COPY(varno) ((GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(varno)))
+
#define PG_GSERIALIZED_DATUM_NEEDS_DETOAST(datum) \
(VARATT_IS_EXTENDED((datum)) || VARATT_IS_EXTERNAL((datum)) || VARATT_IS_COMPRESSED((datum)))
+
+#if POSTGIS_PGSQL_VERSION >= 190
+#define PG_GETARG_GSERIALIZED_HEADER(varno) \
+ PG_GSERIALIZED_DATUM_NEEDS_DETOAST(DatumGetPointer(PG_GETARG_DATUM(varno))) \
+ ? ((GSERIALIZED *)PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(varno), 0, gserialized_max_header_size())) \
+ : ((GSERIALIZED *)(PG_GETARG_POINTER(varno)))
+#else
#define PG_GETARG_GSERIALIZED_HEADER(varno) \
PG_GSERIALIZED_DATUM_NEEDS_DETOAST(PG_GETARG_DATUM(varno)) \
? ((GSERIALIZED *)PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(varno), 0, gserialized_max_header_size())) \
: ((GSERIALIZED *)(PG_GETARG_DATUM(varno)))
+#endif
/* Debugging macros */
#if POSTGIS_DEBUG_LEVEL > 0
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/cunit/cu_measures.c | 8 ++++++++
liblwgeom/lwalgorithm.c | 22 ++++------------------
libpgcommon/lwgeom_pg.h | 10 ++++++++++
3 files changed, 22 insertions(+), 18 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list