]> granicus.if.org Git - postgis/commitdiff
#3367, ST_RemoveRepeatedPoints fix for EMPTY geometry
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 10 Nov 2015 20:23:14 +0000 (20:23 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 10 Nov 2015 20:23:14 +0000 (20:23 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14377 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeom.c
regress/tickets.sql
regress/tickets_expected

index f07b4ac15d2bcd08dcb193eebfd0c48b6bd6f89b..08deb5d60e856af27e60617420db82888eaffcd3 100644 (file)
@@ -1409,6 +1409,11 @@ extern LWGEOM* lwgeom_remove_repeated_points(LWGEOM *in, double tolerance)
        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:
index 5a651eab6f0b19f33297cff78daf4c89cc9c8043..03915fbb8a2b478f02e99935c198059f7ada9fd9 100644 (file)
@@ -925,5 +925,7 @@ FROM (VALUES (
  ('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;
index a5daada149dba8aca6c8c2498f45ed80a5f16521..69144dcf31fb7c1b34cb614ea42d30e7bf5dac83 100644 (file)
@@ -280,3 +280,4 @@ ERROR:  invalid GML representation
 #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