[postgis-tickets] r17796 - Fix ST_RemoveRepeatedPoints output having an outdated bbox
Raul
raul at rmr.ninja
Fri Aug 30 06:35:45 PDT 2019
Author: algunenano
Date: 2019-08-30 06:35:44 -0700 (Fri, 30 Aug 2019)
New Revision: 17796
Modified:
branches/2.3/NEWS
branches/2.3/postgis/lwgeom_functions_basic.c
branches/2.3/regress/remove_repeated_points.sql
branches/2.3/regress/remove_repeated_points_expected
Log:
Fix ST_RemoveRepeatedPoints output having an outdated bbox
Closes #4493
Modified: branches/2.3/NEWS
===================================================================
--- branches/2.3/NEWS 2019-08-30 13:33:48 UTC (rev 17795)
+++ branches/2.3/NEWS 2019-08-30 13:35:44 UTC (rev 17796)
@@ -6,6 +6,7 @@
- #4475, Avoid reading into empty ptarray (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.3.10
2019/08/11
Modified: branches/2.3/postgis/lwgeom_functions_basic.c
===================================================================
--- branches/2.3/postgis/lwgeom_functions_basic.c 2019-08-30 13:33:48 UTC (rev 17795)
+++ branches/2.3/postgis/lwgeom_functions_basic.c 2019-08-30 13:35:44 UTC (rev 17796)
@@ -2671,6 +2671,14 @@
tolerance = PG_GETARG_FLOAT8(1);
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.3/regress/remove_repeated_points.sql
===================================================================
--- branches/2.3/regress/remove_repeated_points.sql 2019-08-30 13:33:48 UTC (rev 17795)
+++ branches/2.3/regress/remove_repeated_points.sql 2019-08-30 13:35:44 UTC (rev 17796)
@@ -23,3 +23,9 @@
SELECT 13, ST_AsText(ST_RemoveRepeatedPoints('LINESTRING(0 0, 1 0, 2 0, 3 0, 4 0)',1.5));
SELECT 14, ST_AsText(ST_RemoveRepeatedPoints('LINESTRING(10 0,10 9,10 10)', 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.3/regress/remove_repeated_points_expected
===================================================================
--- branches/2.3/regress/remove_repeated_points_expected 2019-08-30 13:33:48 UTC (rev 17795)
+++ branches/2.3/regress/remove_repeated_points_expected 2019-08-30 13:35:44 UTC (rev 17796)
@@ -13,3 +13,4 @@
12|3
13|LINESTRING(0 0,2 0,4 0)
14|LINESTRING(10 0,10 10)
+19|POLYGON((0 0,10 0,10 10,10 10,0 10,0 0))|BOX(0 0,10 10)
More information about the postgis-tickets
mailing list