[postgis-tickets] [SCM] PostGIS branch stable-2.5 updated. 2.5.5-8-ge9b9d34

git at osgeo.org git at osgeo.org
Fri Feb 26 11:57:55 PST 2021


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-2.5 has been updated
       via  e9b9d34339515882ae4927ead8e44539438950e6 (commit)
       via  3cc50059baecf6165ad63d7ff4175f9a211a5aa0 (commit)
       via  9826b5cc3cf5e475b1f95b5bd176345030b3a52d (commit)
      from  279df533083aaa5d8926bbdfb55a5fd43fefa1ea (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 e9b9d34339515882ae4927ead8e44539438950e6
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Feb 26 10:36:44 2021 -0800

    Ensure bboxes are refreshed after cooridinate transforms in scale/affine. References #4863

diff --git a/NEWS b/NEWS
index d3fec34..18ddb5f 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ YYYY/MM/DD
 
   - #4757, Handle line collapse due to snap-to-existing node (Sandro Santilli)
   - #4769, Fix segfault in st_addband (Raúl Marín)
+  - #4863, Update bboxes after affine/scale operations (Paul Ramsey)
+
 
 PostGIS 2.5.5
 2020/08/15
diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c
index 12873ed..896af66 100644
--- a/liblwgeom/lwgeom.c
+++ b/liblwgeom/lwgeom.c
@@ -2029,6 +2029,9 @@ lwgeom_affine(LWGEOM *geom, const AFFINE *affine)
 		}
 	}
 
+	/* Recompute bbox if needed */
+	if (geom->bbox)
+		lwgeom_refresh_bbox(geom);
 }
 
 void
@@ -2081,19 +2084,8 @@ lwgeom_scale(LWGEOM *geom, const POINT4D *factor)
 	}
 
 	/* Recompute bbox if needed */
-
-	if ( geom->bbox )
-	{
-		/* TODO: expose a gbox_scale function */
-		geom->bbox->xmin *= factor->x;
-		geom->bbox->xmax *= factor->x;
-		geom->bbox->ymin *= factor->y;
-		geom->bbox->ymax *= factor->y;
-		geom->bbox->zmin *= factor->z;
-		geom->bbox->zmax *= factor->z;
-		geom->bbox->mmin *= factor->m;
-		geom->bbox->mmax *= factor->m;
-	}
+	if (geom->bbox)
+		lwgeom_refresh_bbox(geom);
 }
 
 LWGEOM*
diff --git a/regress/tickets.sql b/regress/tickets.sql
index f5addc4..3d7c701 100644
--- a/regress/tickets.sql
+++ b/regress/tickets.sql
@@ -1125,4 +1125,11 @@ SELECT '#4670-1', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geomet
 SELECT '#4670-2', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 2));
 SELECT '#4670-3', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 3));
 SELECT '#4670-4', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 4));
-SELECT '#4670-5', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 5));
\ No newline at end of file
+SELECT '#4670-5', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geometry, 'POINT(2 2)'::geometry, 5));
+
+SELECT '#4863', st_contains(geometry, st_scale(st_orientedenvelope(geometry),
+ 'SRID=3857; POINT(0.8 0.8)', st_centroid(geometry))) from (select
+ 'SRID=3857; POLYGON((-141972.789895508 6755731.24770785,-141935.49511986
+ 6755733.56891884,-141934.403428904 6755716.1146343,-141971.698204552
+ 6755713.77835553,-141972.789895508 6755731.24770785))'::geometry as
+ geometry) x;
diff --git a/regress/tickets_expected b/regress/tickets_expected
index cf76f6f..96372d5 100644
--- a/regress/tickets_expected
+++ b/regress/tickets_expected
@@ -345,3 +345,4 @@ NOTICE:  table "bug_4144_table" does not exist, skipping
 #4670-3|LINESTRING(0 0,1 1,3 3,2 2,4 4)
 #4670-4|LINESTRING(0 0,1 1,3 3,4 4,2 2)
 ERROR:  LWGEOM_addpoint: Invalid offset
+#4863|t

commit 3cc50059baecf6165ad63d7ff4175f9a211a5aa0
Merge: 9826b5c 279df53
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Feb 26 11:53:44 2021 -0800

    Merge branch 'stable-2.5' of https://git.osgeo.org/gitea/postgis/postgis into stable-2.5


commit 9826b5cc3cf5e475b1f95b5bd176345030b3a52d
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Nov 5 14:45:55 2020 -0800

    Long-standing bug in pole adjustment code for bounding boxes.
    Results in incorrect box for shapes wrapping the negative Y geocentric axis (-90,0)
    Closes #4727

diff --git a/NEWS b/NEWS
index 9586eee..fda3804 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ PostGIS 2.5.5
   - #4691, Fix segfault during gist index creation with empty geometries (Raúl Marín)
   - #4541, ST_ConcaveHull returns a "geometrycollection"
            type instead of the expected "polygon" (Regina Obe)
+  - #4727, Fix geocentric bounding box computation for rare case (Paul Ramsey)
 
 PostGIS 2.5.4
 2020/02/28
diff --git a/liblwgeom/lwgeodetic.c b/liblwgeom/lwgeodetic.c
index c5dfb8b..85ab13f 100644
--- a/liblwgeom/lwgeodetic.c
+++ b/liblwgeom/lwgeodetic.c
@@ -360,7 +360,7 @@ static int gbox_check_poles(GBOX *gbox)
 		else if ((gbox->ymin < 0.0) && (gbox->ymax < 0.0))
 		{
 			LWDEBUG(4, "enclosed negative y axis");
-			gbox->ymax = -1.0;
+			gbox->ymin = -1.0;
 		}
 		else
 		{

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

Summary of changes:
 NEWS                     |  3 +++
 liblwgeom/lwgeodetic.c   |  2 +-
 liblwgeom/lwgeom.c       | 18 +++++-------------
 regress/tickets.sql      |  9 ++++++++-
 regress/tickets_expected |  1 +
 5 files changed, 18 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list