]> granicus.if.org Git - postgis/commitdiff
Fix ST_DumpPoints not to relay on NULL return from ST_NumGeometries to tell multi...
authorSandro Santilli <strk@keybit.net>
Fri, 12 Mar 2010 15:15:44 +0000 (15:15 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 12 Mar 2010 15:15:44 +0000 (15:15 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@5427 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/postgis.sql.in.c

index 7d143bf81601dd20ee6abd1701a27a612d356b4f..b1cf5d8b893c05fdde9cc6ec79b1ed014e941b49 100644 (file)
@@ -1943,15 +1943,17 @@ DECLARE
   i integer;
   j integer;
   g geometry;
+  typ text;
   
 BEGIN
   
   RAISE DEBUG '%,%', cur_path, ST_GeometryType(the_geom);
 
   -- Special case (MULTI* OR GEOMETRYCOLLECTION) : iterate and return the DumpPoints of the geometries
-  SELECT ST_NumGeometries(the_geom) INTO nb_geom;
+  SELECT ST_GeometryType(the_geom) INTO typ;
 
-  IF (nb_geom IS NOT NULL) THEN
+  -- Dont we have an ST_isMulti ?
+  IF (typ like 'ST_Multi%' OR typ = 'ST_GeometryCollection') THEN
     
     i = 1;
     FOR tmp2 IN SELECT (ST_Dump(the_geom)).* LOOP