[SCM] PostGIS branch master updated. 3.5.0-24-g26eb9730c

git at osgeo.org git at osgeo.org
Mon Oct 21 11:48:40 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, master has been updated
       via  26eb9730c8d7edf346a9ea43ec22607d92b23777 (commit)
      from  44f50df6e38f710ca4ef412fb281152b89cd5b5f (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 26eb9730c8d7edf346a9ea43ec22607d92b23777
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 e035f6c71..7040644c3 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PostGIS 3.6.0
 
 * Breaking Changes *
 
+#5799, make ST_TileEnvelope clips 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                             | 1 +
 postgis/lwgeom_functions_basic.c | 4 +++-
 regress/core/regress_expected    | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list