I am trying to ST_Dump a geometry_dump column comprised of points and paths in PostGIS 2.0 using
SELECT (ST_Dump(geom)).geom FROM pointdumpHowever, I get the error message 'function st_dump(geometry_dump) does not exist'
I thought that ST_Dump would dump a geometry_dump column into its constituent parts? Or is there another method I can use? Eventually, I want to draw lines between these points to create rectangles.
This column was created by using this function I discovered online elsewhere and ran on a simple polygon:
CREATE OR REPLACE FUNCTION st_dumppoints_plpgsql(geometry) RETURNS SETOF geometry_dump AS$BODY$DECLARE m integer; g geometry; n integer; p geometry_dump%ROWTYPE;BEGIN IF GeometryType($1) LIKE 'MULTI%' THEN FOR m IN SELECT generate_series(1, ST_NumGeometries($1)) LOOP p.path[1] := m; -- use to store Multipolygon number g := ST_Boundary(ST_GeometryN($1, m)); FOR n IN SELECT generate_series(1, ST_NumPoints(g) - 1) LOOP p.path[2] := n; -- use to store Point number p.geom := ST_PointN(g, n); RETURN NEXT p; END LOOP; END LOOP; ELSE -- It is not a MULTI- geometry g := ST_Boundary($1); FOR n IN SELECT generate_series(1, ST_NumPoints(g) - 1) LOOP p.path[1] := n; -- use to store Point number p.geom := ST_PointN(g, n); RETURN NEXT p; END LOOP; END IF; RETURN;END;$BODY$ LANGUAGE 'plpgsql' IMMUTABLE STRICT COST 100 ROWS 1000;
أكثر...
SELECT (ST_Dump(geom)).geom FROM pointdumpHowever, I get the error message 'function st_dump(geometry_dump) does not exist'
I thought that ST_Dump would dump a geometry_dump column into its constituent parts? Or is there another method I can use? Eventually, I want to draw lines between these points to create rectangles.
This column was created by using this function I discovered online elsewhere and ran on a simple polygon:
CREATE OR REPLACE FUNCTION st_dumppoints_plpgsql(geometry) RETURNS SETOF geometry_dump AS$BODY$DECLARE m integer; g geometry; n integer; p geometry_dump%ROWTYPE;BEGIN IF GeometryType($1) LIKE 'MULTI%' THEN FOR m IN SELECT generate_series(1, ST_NumGeometries($1)) LOOP p.path[1] := m; -- use to store Multipolygon number g := ST_Boundary(ST_GeometryN($1, m)); FOR n IN SELECT generate_series(1, ST_NumPoints(g) - 1) LOOP p.path[2] := n; -- use to store Point number p.geom := ST_PointN(g, n); RETURN NEXT p; END LOOP; END LOOP; ELSE -- It is not a MULTI- geometry g := ST_Boundary($1); FOR n IN SELECT generate_series(1, ST_NumPoints(g) - 1) LOOP p.path[1] := n; -- use to store Point number p.geom := ST_PointN(g, n); RETURN NEXT p; END LOOP; END IF; RETURN;END;$BODY$ LANGUAGE 'plpgsql' IMMUTABLE STRICT COST 100 ROWS 1000;
أكثر...