[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.1-21-g055b74d

git at osgeo.org git at osgeo.org
Fri Feb 26 11:42:48 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-3.1 has been updated
       via  055b74db4f778088dbf4d4077908e2f014bcb6e5 (commit)
       via  99eebdc3dbd2a7856265bb555c5d7bb82804a622 (commit)
      from  fca92faee92c151b6ae94866af7834cb5008d2d4 (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 055b74db4f778088dbf4d4077908e2f014bcb6e5
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/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c
index 34c1fea..a2d3d7f 100644
--- a/liblwgeom/lwgeom.c
+++ b/liblwgeom/lwgeom.c
@@ -2019,6 +2019,9 @@ lwgeom_affine(LWGEOM *geom, const AFFINE *affine)
 		}
 	}
 
+	/* Recompute bbox if needed */
+	if (geom->bbox)
+		lwgeom_refresh_bbox(geom);
 }
 
 void
@@ -2071,19 +2074,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/core/tickets.sql b/regress/core/tickets.sql
index 4759cb5..4ff7c34 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1344,3 +1344,9 @@ SELECT '#4844', ST_AsEWKT(ST_SnapToGrid(ST_Transform('SRID=3575;POINT(370182.359
 
 SELECT '#4853', ST_ClusterDBSCAN(geom,  eps := 0.000906495804256269, minpoints := 4) OVER() AS cid FROM (VALUES ('0101000020E6100000E4141DC9E5934B40D235936FB6193940'::geometry), ('0101000020E6100000C746205ED7934B40191C25AFCE193940'::geometry), ('0101000020E6100000C780ECF5EE934B40B6BE4868CB193940'::geometry), ('0101000020E6100000ABB2EF8AE0934B404451A04FE4193940'::geometry)) AS t(geom);
 
+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/core/tickets_expected b/regress/core/tickets_expected
index 58caed0..d0449e0 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -446,3 +446,4 @@ ERROR:  LWGEOM_addpoint: Invalid offset
 #4853|0
 #4853|0
 #4853|0
+#4863|t

commit 99eebdc3dbd2a7856265bb555c5d7bb82804a622
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Feb 26 10:29:40 2021 -0800

    Make cunit makevalid test stronger relative to different GEOS versions (normalize)

diff --git a/liblwgeom/cunit/cu_geos.c b/liblwgeom/cunit/cu_geos.c
index 1e4948e..714c3f0 100644
--- a/liblwgeom/cunit/cu_geos.c
+++ b/liblwgeom/cunit/cu_geos.c
@@ -142,23 +142,27 @@ test_geos_makevalid(void)
 	char* out_ewkt;
 	LWGEOM* geom1;
 	LWGEOM* geom2;
+	LWGEOM* geom2norm;
 
 	wkb = (uint8_t*) "\001\003\000\000\000\001\000\000\000\011\000\000\000b\020X9 }\366 at 7\211A\340\235I\034A\316\326t18}\366@\306g\347\323\230I\034Ay\351&18}\366@\331\316\367\323\230I\034A\372~j\274\370}\366@\315\314\314LpI\034A\343\245\233\304R}\366 at R\270\036\005?I\034A\315\314\314\314Z~\366@\343\245\233\304\007I\034A\004V\016-\242}\366@\252\361\322M\323H\034A\351&1\010\306{\366 at H\341z\0247I\034Ab\020X9 }\366 at 7\211A\340\235I\034A";
 	geom1 = lwgeom_from_wkb(wkb, 157, LW_PARSER_CHECK_NONE);
 	geom2 = lwgeom_make_valid(geom1);
-	out_ewkt = lwgeom_to_ewkt((LWGEOM*)geom2);
+	geom2norm = lwgeom_normalize(geom2);
+
+	out_ewkt = lwgeom_to_ewkt((LWGEOM*)geom2norm);
 #if POSTGIS_GEOS_VERSION < 39
 	ASSERT_STRING_EQUAL(
 	    out_ewkt,
-	    "GEOMETRYCOLLECTION(POLYGON((92114.014 463463.469,92115.51207431706 463462.206937429,92115.512 463462.207,92127.546 463452.075,92117.173 463439.755,92133.675 463425.942,92122.136 463412.82600000006,92092.377 463437.77,92114.014 463463.469)),MULTIPOINT(92115.51207431706 463462.2069374289,92122.136 463412.826))");
+	    "GEOMETRYCOLLECTION(POLYGON((92092.377 463437.77,92114.014 463463.469,92115.51207431706 463462.206937429,92115.512 463462.207,92127.546 463452.075,92117.173 463439.755,92133.675 463425.942,92122.136 463412.82600000006,92092.377 463437.77)),MULTIPOINT(92122.136 463412.826,92115.51207431706 463462.2069374289))");
 #else
 	ASSERT_STRING_EQUAL(
 	    out_ewkt,
-	    "POLYGON((92127.546 463452.075,92117.173 463439.755,92133.675 463425.942,92122.136 463412.826,92092.377 463437.77,92114.014 463463.469,92115.512 463462.207,92115.51207431706 463462.2069374289,92127.546 463452.075))");
+	    "POLYGON((92092.377 463437.77,92114.014 463463.469,92115.512 463462.207,92115.51207431706 463462.2069374289,92127.546 463452.075,92117.173 463439.755,92133.675 463425.942,92122.136 463412.826,92092.377 463437.77))");
 #endif
 	lwfree(out_ewkt);
 	lwgeom_free(geom1);
 	lwgeom_free(geom2);
+	lwgeom_free(geom2norm);
 }
 
 

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

Summary of changes:
 liblwgeom/cunit/cu_geos.c     | 10 +++++++---
 liblwgeom/lwgeom.c            | 18 +++++-------------
 regress/core/tickets.sql      |  6 ++++++
 regress/core/tickets_expected |  1 +
 4 files changed, 19 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list