[SCM] PostGIS branch master updated. 3.6.0rc2-83-g389eaee28
git at osgeo.org
git at osgeo.org
Mon Oct 6 12:49:27 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, master has been updated
via 389eaee2863b5b1d06a33670621f98bf56438680 (commit)
from ac17b1d6a6364a81ad7a124b2f9ae257bda51e91 (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 389eaee2863b5b1d06a33670621f98bf56438680
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Mon Oct 6 12:49:11 2025 -0700
Make PostGIS and GEOS consistent in handling clipping at the border of the rectangle (both now clip boundary vertices)
References #5962
diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c
index 16ee36e89..339214f0d 100644
--- a/postgis/lwgeom_geos.c
+++ b/postgis/lwgeom_geos.c
@@ -1546,8 +1546,9 @@ Datum ST_ClipByBox2d(PG_FUNCTION_ARGS)
bbox2 = (GBOX *)PG_GETARG_POINTER(box2d_idx);
bbox2->flags = 0;
- /* if bbox1 is covered by bbox2, return lwgeom1 */
- if (gbox_contains_2d(bbox2, &bbox1))
+ /* If bbox1 is strictly contained by bbox2, return input geometry */
+ if (bbox2->xmin < bbox1.xmin && bbox2->xmax > bbox1.xmax &&
+ bbox2->ymin < bbox1.ymin && bbox2->ymax > bbox1.ymax)
{
PG_RETURN_DATUM(PG_GETARG_DATUM(geom_idx));
}
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index 46490a912..4b580b003 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1613,3 +1613,13 @@ CREATE TABLE test5987 (geom geometry(Geometry,4326));
INSERT INTO test5987 VALUES('LINESTRING(20 20,20.1 20,20.2 19.9)'::geometry);
SELECT '#5987', ST_AsText(geom), ST_AsText(ST_GeometryN(geom, 1)) FROM test5987;
DROP TABLE IF EXISTS test5987;
+
+-- -------------------------------------------------------------------------------------
+-- #5962
+SELECT '#5962',
+ ST_AsText(ST_ClipByBox2D(
+ ST_GeomFromText('MULTIPOINT((1 1),(3 4),(5 4))'),
+ ST_MakeEnvelope(0, 0, 5, 5)), 2),
+ ST_AsText(ST_ClipByBox2D(
+ ST_GeomFromText('MULTIPOINT((1 1),(6 4),(5 4))'),
+ ST_MakeEnvelope(0, 0, 5, 5 )), 2);
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index dd5538e62..0f2bf2f39 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -491,3 +491,4 @@ public|test5829|geom|2|4326|GEOMETRY
public|test5978|geometry|2|4326|POINT
public|test5978|shape|2|4326|POINT
#5987|LINESTRING(20 20,20.1 20,20.2 19.9)|LINESTRING(20 20,20.1 20,20.2 19.9)
+#5962|MULTIPOINT((1 1),(3 4))|POINT(1 1)
-----------------------------------------------------------------------
Summary of changes:
postgis/lwgeom_geos.c | 5 +++--
regress/core/tickets.sql | 10 ++++++++++
regress/core/tickets_expected | 1 +
3 files changed, 14 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list