Database Reference
In-Depth Information
-- add a top to the building
buildingTop AS
(
SELECT ST_Translate(ST_Force3DZ($1), 0, 0,
$2) AS the_geom
),
-- and a floor
buildingBottom AS
(
SELECT ST_Translate(ST_Force3DZ($1), 0, 0, 0)
AS the_geom
),
-- now we put the walls, roof, and floor
together
wholeBuilding AS
(
SELECT the_geom FROM buildingBottom
UNION ALL
SELECT the_geom FROM threeDwall
UNION ALL
SELECT the_geom FROM buildingTop
),
-- then convert this collecion to a multipolygon
multiBuilding AS
(
SELECT ST_Multi(ST_Collect(the_geom)) AS
the_geom FROM wholeBuilding
),
-- While we could leave this as a multipolygon,
we'll do things properly and munge an informal
cast
-- to polyhedralsurfacem which is more widely
recognized as the appropriate format for a
geometry like
-- this. In our case, we are already formatted
as a polyhedralsurface, minus the official
designation,
-- so we'll just convert to text, replace the
Search WWH ::




Custom Search