Database Reference
In-Depth Information
word MULTIPOLYGON with POLYHEDRALSURFACE and
then convert
-- back to geometry with ST_GeomFromText
textBuilding AS
(
SELECT ST_AsText(the_geom) textbuilding FROM
multiBuilding
),
textBuildSurface AS
(
SELECT ST_GeomFromText(replace(textbuilding,
'MULTIPOLYGON', 'POLYHEDRALSURFACE')) AS
the_geom FROM textBuilding
)
SELECT the_geom FROM textBuildSurface
;
$BODY$
LANGUAGE sql VOLATILE
COST 100;
ALTER FUNCTION chp07.threedbuilding(geometry,
numeric)
OWNER TO me;
How to do it...
Nowthatwehavea3D-buildingextrusionfunction,wecaneasilyextrudeourbuild-
ing footprint with our nicely encapsulated function, as follows:
CREATE TABLE chp07.threed_building AS
SELECT chp07.threeDbuilding(the_geom, 10) AS
the_geom FROM chp07.simple_building;
We can apply this function to a real building footprint dataset, in which case, if we
have a height field, we can extrude according to that:
Search WWH ::




Custom Search