[postgis-tickets] r14377 - #3367, ST_RemoveRepeatedPoints fix for EMPTY geometry
Paul Ramsey
pramsey at cleverelephant.ca
Tue Nov 10 12:23:15 PST 2015
Author: pramsey
Date: 2015-11-10 12:23:14 -0800 (Tue, 10 Nov 2015)
New Revision: 14377
Modified:
trunk/liblwgeom/lwgeom.c
trunk/regress/tickets.sql
trunk/regress/tickets_expected
Log:
#3367, ST_RemoveRepeatedPoints fix for EMPTY geometry
Modified: trunk/liblwgeom/lwgeom.c
===================================================================
--- trunk/liblwgeom/lwgeom.c 2015-11-10 20:23:09 UTC (rev 14376)
+++ trunk/liblwgeom/lwgeom.c 2015-11-10 20:23:14 UTC (rev 14377)
@@ -1409,6 +1409,11 @@
LWDEBUGF(4, "lwgeom_remove_repeated_points got type %s",
lwtype_name(in->type));
+ if(lwgeom_is_empty(in))
+ {
+ return lwgeom_clone_deep(in);
+ }
+
switch (in->type)
{
case MULTIPOINTTYPE:
Modified: trunk/regress/tickets.sql
===================================================================
--- trunk/regress/tickets.sql 2015-11-10 20:23:09 UTC (rev 14376)
+++ trunk/regress/tickets.sql 2015-11-10 20:23:14 UTC (rev 14377)
@@ -925,5 +925,7 @@
('LINESTRING(124.983539 1.419224,91.181596 29.647798, 91.28 29.647)'::text ) ) As f(wkt)
ORDER BY wkt;
+SELECT '#3367', ST_AsText(ST_RemoveRepeatedPoints('POLYGON EMPTY'::geometry));
+
-- Clean up
DELETE FROM spatial_ref_sys;
Modified: trunk/regress/tickets_expected
===================================================================
--- trunk/regress/tickets_expected 2015-11-10 20:23:09 UTC (rev 14376)
+++ trunk/regress/tickets_expected 2015-11-10 20:23:14 UTC (rev 14377)
@@ -280,3 +280,4 @@
#3355|t
#3356|LineString[] with 2 points|LineString[GS] with 2 points|LineString[GS] with 2 points
#3356|LineString[B] with 3 points|LineString[BGS] with 3 points|LineString[BGS] with 3 points
+#3367|POLYGON EMPTY
More information about the postgis-tickets
mailing list