[postgis-tickets] r17782 - Fix ST_Simplify ignoring the value of the 3rd parameter
Raul
raul at rmr.ninja
Thu Aug 29 04:51:54 PDT 2019
Author: algunenano
Date: 2019-08-29 04:51:54 -0700 (Thu, 29 Aug 2019)
New Revision: 17782
Modified:
trunk/NEWS
trunk/postgis/lwgeom_functions_analytic.c
trunk/regress/core/simplify.sql
trunk/regress/core/simplify_expected
Log:
Fix ST_Simplify ignoring the value of the 3rd parameter
References #4492
Closes https://github.com/postgis/postgis/pull/469
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2019-08-29 08:59:26 UTC (rev 17781)
+++ trunk/NEWS 2019-08-29 11:51:54 UTC (rev 17782)
@@ -1,3 +1,12 @@
+PostGIS 3.0.0alpha5
+XXXX/XX/XX
+For full changes and enhancements, refer to PostGIS 3.0.0.
+This version requires PostgreSQL 9.5+-12 and GEOS >= 3.6+
+Additional features enabled if you are running Proj6+ and PostgreSQL 12
+
+* Major highlights *
+ - #4492, Fix ST_Simplify ignoring the value of the 3rd parameter (Raúl Marín)
+
PostGIS 3.0.0alpha4
2019/08/10
For full changes and enhancements, refer to PostGIS 3.0.0.
Modified: trunk/postgis/lwgeom_functions_analytic.c
===================================================================
--- trunk/postgis/lwgeom_functions_analytic.c 2019-08-29 08:59:26 UTC (rev 17781)
+++ trunk/postgis/lwgeom_functions_analytic.c 2019-08-29 11:51:54 UTC (rev 17782)
@@ -71,8 +71,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: trunk/regress/core/simplify.sql
===================================================================
--- trunk/regress/core/simplify.sql 2019-08-29 08:59:26 UTC (rev 17781)
+++ trunk/regress/core/simplify.sql 2019-08-29 11:51:54 UTC (rev 17782)
@@ -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: trunk/regress/core/simplify_expected
===================================================================
--- trunk/regress/core/simplify_expected 2019-08-29 08:59:26 UTC (rev 17781)
+++ trunk/regress/core/simplify_expected 2019-08-29 11:51:54 UTC (rev 17782)
@@ -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