From 9e25bdc8e880666d8d4c262166c3648649dab91b Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 12 Mar 2010 15:15:44 +0000 Subject: [PATCH] Fix ST_DumpPoints not to relay on NULL return from ST_NumGeometries to tell multi and singles apart git-svn-id: http://svn.osgeo.org/postgis/trunk@5427 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/postgis.sql.in.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/postgis/postgis.sql.in.c b/postgis/postgis.sql.in.c index 7d143bf81..b1cf5d8b8 100644 --- a/postgis/postgis.sql.in.c +++ b/postgis/postgis.sql.in.c @@ -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 -- 2.40.0