[postgis-tickets] r14376 - #3367, ST_RemoveRepeatedPoints fix for EMPTY geometry

Paul Ramsey pramsey at cleverelephant.ca
Tue Nov 10 12:23:09 PST 2015


Author: pramsey
Date: 2015-11-10 12:23:09 -0800 (Tue, 10 Nov 2015)
New Revision: 14376

Modified:
   branches/2.2/liblwgeom/lwgeom.c
   branches/2.2/regress/tickets.sql
   branches/2.2/regress/tickets_expected
Log:
#3367, ST_RemoveRepeatedPoints fix for EMPTY geometry


Modified: branches/2.2/liblwgeom/lwgeom.c
===================================================================
--- branches/2.2/liblwgeom/lwgeom.c	2015-11-07 10:39:19 UTC (rev 14375)
+++ branches/2.2/liblwgeom/lwgeom.c	2015-11-10 20:23:09 UTC (rev 14376)
@@ -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: branches/2.2/regress/tickets.sql
===================================================================
--- branches/2.2/regress/tickets.sql	2015-11-07 10:39:19 UTC (rev 14375)
+++ branches/2.2/regress/tickets.sql	2015-11-10 20:23:09 UTC (rev 14376)
@@ -913,5 +913,7 @@
 
 SELECT '#3300', ST_AsText(ST_SnapToGrid(Box2D('CURVEPOLYGON(CIRCULARSTRING(-71.0821 42.3036,-71.4821 42.3036,-71.7821 42.7036,-71.0821 42.7036,-71.0821 42.3036),(-71.1821 42.4036,-71.3821 42.6036,-71.3821 42.4036,-71.1821 42.4036))'::Geometry)::geometry,0.0001));
 
+SELECT '#3367', ST_AsText(ST_RemoveRepeatedPoints('POLYGON EMPTY'::geometry));
+
 -- Clean up
 DELETE FROM spatial_ref_sys;

Modified: branches/2.2/regress/tickets_expected
===================================================================
--- branches/2.2/regress/tickets_expected	2015-11-07 10:39:19 UTC (rev 14375)
+++ branches/2.2/regress/tickets_expected	2015-11-10 20:23:09 UTC (rev 14376)
@@ -277,3 +277,4 @@
 #2956|t
 #3172|LINESTRING M (0 0 1,0 0 2)
 #3300|POLYGON((-71.7821 42.2622,-71.7821 42.9067,-71.029 42.9067,-71.029 42.2622,-71.7821 42.2622))
+#3367|POLYGON EMPTY



More information about the postgis-tickets mailing list