[postgis-tickets] r17785 - Fix ST_Simplify ignoring the value of the 3rd parameter

Raul raul at rmr.ninja
Thu Aug 29 04:56:36 PDT 2019


Author: algunenano
Date: 2019-08-29 04:56:36 -0700 (Thu, 29 Aug 2019)
New Revision: 17785

Modified:
   branches/2.3/NEWS
   branches/2.3/postgis/lwgeom_functions_analytic.c
   branches/2.3/regress/simplify.sql
   branches/2.3/regress/simplify_expected
Log:
Fix ST_Simplify ignoring the value of the 3rd parameter

Closes #4492



Modified: branches/2.3/NEWS
===================================================================
--- branches/2.3/NEWS	2019-08-29 11:54:22 UTC (rev 17784)
+++ branches/2.3/NEWS	2019-08-29 11:56:36 UTC (rev 17785)
@@ -1,5 +1,13 @@
+PostGIS 2.3.11
+XXXX/XX/XX
+
+  * Bug Fixes and Enhancements *
+
+  - #4475, Avoid reading into empty ptarray (Paul Ramsey)
+  - #4492, Fix ST_Simplify ignoring the value of the 3rd parameter (Raúl Marín)
+
 PostGIS 2.3.10
-2019/08/XX
+2019/08/11
 
   * Bug Fixes and Enhancements *
 
@@ -12,7 +20,6 @@
   - #4209, Handle NULL geometry values in pgsql2shp (Paul Ramsey)
   - #4437, Handle POINT EMPTY in shape loader/dumper (Paul Ramsey)
   - #4470, ST_GeomFromGeoJSON crash on empty rings (Darafei Praliaskouski)
-  - #4475, Avoid reading into empty ptarray (Paul Ramsey)
 
 PostGIS 2.3.9
 2019/03/11

Modified: branches/2.3/postgis/lwgeom_functions_analytic.c
===================================================================
--- branches/2.3/postgis/lwgeom_functions_analytic.c	2019-08-29 11:54:22 UTC (rev 17784)
+++ branches/2.3/postgis/lwgeom_functions_analytic.c	2019-08-29 11:56:36 UTC (rev 17785)
@@ -74,8 +74,8 @@
 	bool preserve_collapsed = false;
 
 	/* Handle optional argument to preserve collapsed features */
-	if ( PG_NARGS() > 2 && ! PG_ARGISNULL(2) )
-		preserve_collapsed = true;
+	if ((PG_NARGS() > 2) && (!PG_ARGISNULL(2)))
+		preserve_collapsed = PG_GETARG_BOOL(2);
 
 	/* Can't simplify points! */
 	if ( type == POINTTYPE || type == MULTIPOINTTYPE )

Modified: branches/2.3/regress/simplify.sql
===================================================================
--- branches/2.3/regress/simplify.sql	2019-08-29 11:54:22 UTC (rev 17784)
+++ branches/2.3/regress/simplify.sql	2019-08-29 11:56:36 UTC (rev 17785)
@@ -12,3 +12,6 @@
 SELECT '10', ST_astext(ST_Simplify('LINESTRING(0 0, 0 10)', 20));
 SELECT '11', ST_astext(ST_Simplify('MULTIPOLYGON(((100 100, 100 130, 130 130, 130 100, 100 100)), ((0 0, 10 0, 10 10, 0 10, 0 0),(5 5, 5 6, 6 6, 8 5, 5 5)) )', 20));
 SELECT '12', ST_astext(ST_Simplify('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0),(5 5, 5 6, 6 6, 8 5, 5 5)),((100 100, 100 130, 130 130, 130 100, 100 100)))', 20));
+
+SELECT '13', ST_astext(ST_Simplify('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))', 20, false));
+SELECT '14', ST_astext(ST_Simplify('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))', 20, true));
\ No newline at end of file

Modified: branches/2.3/regress/simplify_expected
===================================================================
--- branches/2.3/regress/simplify_expected	2019-08-29 11:54:22 UTC (rev 17784)
+++ branches/2.3/regress/simplify_expected	2019-08-29 11:56:36 UTC (rev 17785)
@@ -10,3 +10,5 @@
 10|LINESTRING(0 0,0 10)
 11|MULTIPOLYGON(((100 100,100 130,130 130,130 100,100 100)))
 12|MULTIPOLYGON(((100 100,100 130,130 130,130 100,100 100)))
+13|
+14|POLYGON((0 0,10 0,10 10,0 0))



More information about the postgis-tickets mailing list