[postgis-tickets] r17794 - Fix ST_RemoveRepeatedPoints output having an outdated bbox
Raul
raul at rmr.ninja
Fri Aug 30 06:33:00 PDT 2019
Author: algunenano
Date: 2019-08-30 06:33:00 -0700 (Fri, 30 Aug 2019)
New Revision: 17794
Modified:
branches/2.5/NEWS
branches/2.5/postgis/lwgeom_functions_basic.c
branches/2.5/regress/remove_repeated_points.sql
branches/2.5/regress/remove_repeated_points_expected
Log:
Fix ST_RemoveRepeatedPoints output having an outdated bbox
References #4493
Modified: branches/2.5/NEWS
===================================================================
--- branches/2.5/NEWS 2019-08-30 13:31:10 UTC (rev 17793)
+++ branches/2.5/NEWS 2019-08-30 13:33:00 UTC (rev 17794)
@@ -8,6 +8,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.5.3
2019/08/11
Modified: branches/2.5/postgis/lwgeom_functions_basic.c
===================================================================
--- branches/2.5/postgis/lwgeom_functions_basic.c 2019-08-30 13:31:10 UTC (rev 17793)
+++ branches/2.5/postgis/lwgeom_functions_basic.c 2019-08-30 13:33:00 UTC (rev 17794)
@@ -2774,6 +2774,11 @@
lwgeom_in = lwgeom_from_gserialized(g_in);
lwgeom_out = lwgeom_remove_repeated_points(lwgeom_in, tolerance);
+
+ /* COMPUTE_BBOX TAINTING */
+ if (lwgeom_in->bbox)
+ lwgeom_refresh_bbox(lwgeom_out);
+
g_out = geometry_serialize(lwgeom_out);
if ( lwgeom_out != lwgeom_in )
Modified: branches/2.5/regress/remove_repeated_points.sql
===================================================================
--- branches/2.5/regress/remove_repeated_points.sql 2019-08-30 13:31:10 UTC (rev 17793)
+++ branches/2.5/regress/remove_repeated_points.sql 2019-08-30 13:33:00 UTC (rev 17794)
@@ -29,3 +29,9 @@
SELECT 17, ST_AsText(ST_RemoveRepeatedPoints('MULTIPOINT(0 0, 0 0, 1 1, 4 4)'::geometry,2));
SELECT 18, ST_AsText(ST_RemoveRepeatedPoints('POLYGON((-215922 5325694,-218080 5321866,-218693 5322119,-216112 5325812,-215922 5325694))'::geometry, 10000));
+-- 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.5/regress/remove_repeated_points_expected
===================================================================
--- branches/2.5/regress/remove_repeated_points_expected 2019-08-30 13:31:10 UTC (rev 17793)
+++ branches/2.5/regress/remove_repeated_points_expected 2019-08-30 13:33:00 UTC (rev 17794)
@@ -17,3 +17,4 @@
16|MULTIPOINT(0 0,1 1,2 2)
17|MULTIPOINT(0 0,4 4)
18|POLYGON((-215922 5325694,-218693 5322119,-216112 5325812,-215922 5325694))
+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