[postgis-tickets] r17795 - Fix ST_RemoveRepeatedPoints output having an outdated bbox
Raul
raul at rmr.ninja
Fri Aug 30 06:33:49 PDT 2019
Author: algunenano
Date: 2019-08-30 06:33:48 -0700 (Fri, 30 Aug 2019)
New Revision: 17795
Modified:
branches/2.4/NEWS
branches/2.4/postgis/lwgeom_functions_basic.c
branches/2.4/regress/remove_repeated_points.sql
branches/2.4/regress/remove_repeated_points_expected
Log:
Fix ST_RemoveRepeatedPoints output having an outdated bbox
References #4493
Modified: branches/2.4/NEWS
===================================================================
--- branches/2.4/NEWS 2019-08-30 13:33:00 UTC (rev 17794)
+++ branches/2.4/NEWS 2019-08-30 13:33:48 UTC (rev 17795)
@@ -8,6 +8,7 @@
- #4475, Avoid reading into empty ptarra (Paul Ramsey)
- #4492, Fix ST_Simplify ignoring the value of the 3rd parameter (Raúl Marín)
- #4494, Fix ST_Simplify output having an outdated bbox (Raúl Marín)
+ - #4493, Fix ST_RemoveRepeatedPoints output having an outdated bbox (Raúl Marín)
PostGIS 2.4.8
Modified: branches/2.4/postgis/lwgeom_functions_basic.c
===================================================================
--- branches/2.4/postgis/lwgeom_functions_basic.c 2019-08-30 13:33:00 UTC (rev 17794)
+++ branches/2.4/postgis/lwgeom_functions_basic.c 2019-08-30 13:33:48 UTC (rev 17795)
@@ -2646,6 +2646,14 @@
lwgeom_in = lwgeom_from_gserialized(g_in);
lwgeom_out = lwgeom_remove_repeated_points(lwgeom_in, tolerance);
+
+ /* COMPUTE_BBOX TAINTING */
+ if (lwgeom_in->bbox)
+ {
+ lwgeom_drop_bbox(lwgeom_out);
+ lwgeom_add_bbox(lwgeom_out);
+ }
+
g_out = geometry_serialize(lwgeom_out);
if ( lwgeom_out != lwgeom_in )
Modified: branches/2.4/regress/remove_repeated_points.sql
===================================================================
--- branches/2.4/regress/remove_repeated_points.sql 2019-08-30 13:33:00 UTC (rev 17794)
+++ branches/2.4/regress/remove_repeated_points.sql 2019-08-30 13:33:48 UTC (rev 17795)
@@ -29,3 +29,9 @@
SELECT 17, ST_AsText(ST_RemoveRepeatedPoints('MULTIPOINT(0 0, 0 0, 1 1, 4 4)'::geometry,2));
+-- Updates the ouput bbox
+WITH geom AS
+(
+ SELECT ST_RemoveRepeatedPoints('POLYGON((0 0, 10 0, 10 10, 10.5 10.5, 10 10, 0 10, 0 0))', 1) as g
+)
+Select 19, ST_AsText(g) as geometry, postgis_getbbox(g) AS box from geom;
Modified: branches/2.4/regress/remove_repeated_points_expected
===================================================================
--- branches/2.4/regress/remove_repeated_points_expected 2019-08-30 13:33:00 UTC (rev 17794)
+++ branches/2.4/regress/remove_repeated_points_expected 2019-08-30 13:33:48 UTC (rev 17795)
@@ -16,3 +16,4 @@
15|MULTIPOINT(0 0,1 1,2 2)
16|MULTIPOINT(0 0,1 1,2 2)
17|MULTIPOINT(0 0,4 4)
+19|POLYGON((0 0,10 0,10 10,0 10,0 0))|BOX(0 0,10 10)
More information about the postgis-tickets
mailing list