]> granicus.if.org Git - postgis/commitdiff
Empty geometries are cleanest [RT-SIGTA]
authorSandro Santilli <strk@keybit.net>
Tue, 16 Feb 2010 08:28:35 +0000 (08:28 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 16 Feb 2010 08:28:35 +0000 (08:28 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@5251 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/postgis.sql.in.c

index da8686a2860d4575fa38466982dcb5a23abfb042..89a87d000a0fe712e732acb5199322656f0ee42b 100644 (file)
@@ -4059,6 +4059,11 @@ BEGIN
 
   RAISE DEBUG 'ST_CleanGeometry: in: %', ST_GeometryType(gin);
 
+  -- Short-circuit: empty geometry are the cleanest !
+  IF ST_isEmpty(gin) THEN
+    RETURN gin;
+  END IF;
+
   -- Collect all distinct input points
   SELECT INTO pin ST_Union(geom)
     FROM (select (ST_DumpPoints(gin)).geom) as foo;