Database Reference
In-Depth Information
Theprecedingcodereturnseachofthetwo-pointsegmentsofouroriginalshape,for
example, for our simple_building :
st_astext
------------------------------------------------------------------------------
MULTILINESTRING((2 0,2 1),(1 2,0 2),(2 1,1
1),(0 0,2 0),(1 1,1 2),(0 2,0 0))
(1 row)
Nowthatwehaveaseriesofindividuallines,wecanusethosetoconstructthewalls
ofthebuilding.First,weneedtorecastour2Dlinesas3Dusing ST_Force3DZ ,as
follows:
threeDlines AS
(
SELECT ST_Force3DZ(the_geom) AS the_geom FROM
simple_lines
)
Returning:
MULTILINESTRING Z ((2 0 0,2 1 0),(1 2 0,0 2
0),(2 1 0,1 1 0),(0 0 0,2 0 0),(1 1 0,1 2 0),(0
2 0,0 0 0))
Thenextstepistobreakeachofthoselinesfromthemultilinestringintolinestrings.
Forthosepayingattention,you'llnotethattheseareeffectivelylinesmasquerading
as linestrings:
splodedLine AS
(
SELECT (ST_Dump(the_geom)).geom AS the_geom
FROM threeDLines
),
Search WWH ::




Custom Search