[SCM] PostGIS branch stable-3.5 updated. 3.5.0-13-g7b24bdf64
git at osgeo.org
git at osgeo.org
Mon Oct 21 13:11:52 PDT 2024
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 7b24bdf64f539b98dd8b46b72e6b71e44e312435 (commit)
from 6b8ee4d5c6cd30f232c41adea39f96e60eb4b7a6 (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 7b24bdf64f539b98dd8b46b72e6b71e44e312435
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Mon Oct 21 11:48:27 2024 -0700
ST_TileEnvelope with margin is not clipped fully to WM extent, references #5799
diff --git a/NEWS b/NEWS
index da1d98241..f5040a61b 100644
--- a/NEWS
+++ b/NEWS
@@ -75,6 +75,8 @@ Andreas Schild (German Team)
to get valid inputs to feed to the calculation.
- Zero length LineStrings are treated as if they are the
equivalent Point object.
+ - #5799, make ST_TileEnvelope clip envelopes to tile plane
+ extent (Paul Ramsey)
* Deprecated signatures *
diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index c2892ce7e..1f9348c1b 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -2143,9 +2143,11 @@ Datum ST_TileEnvelope(PG_FUNCTION_ARGS)
y1 = bbox.ymax - tileGeoSizeY * (y + 1 + margin);
y2 = bbox.ymax - tileGeoSizeY * (y - margin);
- /* Clip y-axis to the given bounds */
+ /* Clip the final tile bounds to the bounds of the tile plane */
if (y1 < bbox.ymin) y1 = bbox.ymin;
if (y2 > bbox.ymax) y2 = bbox.ymax;
+ if (x1 < bbox.xmin) x1 = bbox.xmin;
+ if (x2 > bbox.xmax) x2 = bbox.xmax;
PG_RETURN_POINTER(
geometry_serialize(
diff --git a/regress/core/regress_expected b/regress/core/regress_expected
index bd34c236a..42a03aaaf 100644
--- a/regress/core/regress_expected
+++ b/regress/core/regress_expected
@@ -204,7 +204,7 @@ ERROR: ST_TileEnvelope: Invalid tile y value, 1
234|POLYGON((-100 87.5,-100 100,-87.5 100,-87.5 87.5,-100 87.5))
235|POLYGON((0 -12.5,0 0,25 0,25 -12.5,0 -12.5))
236|POLYGON((-20037508.34 -20037508.34,-20037508.34 20037508.34,20037508.34 20037508.34,20037508.34 -20037508.34,-20037508.34 -20037508.34))
-237|POLYGON((-22041259.18 -2003750.83,-22041259.18 20037508.34,2003750.83 20037508.34,2003750.83 -2003750.83,-22041259.18 -2003750.83))
+237|POLYGON((-20037508.34 -2003750.83,-20037508.34 20037508.34,2003750.83 20037508.34,2003750.83 -2003750.83,-20037508.34 -2003750.83))
238|POLYGON((-15028131.26 -20037508.34,-15028131.26 -5009377.09,5009377.09 -5009377.09,5009377.09 -20037508.34,-15028131.26 -20037508.34))
239|POLYGON((0 0,0 0,0 0,0 0,0 0))
ERROR: ST_TileEnvelope: Margin must not be less than -50%, margin=-0.510000
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 ++
postgis/lwgeom_functions_basic.c | 4 +++-
regress/core/regress_expected | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list