Database Reference
In-Depth Information
SELECT ST_Union(the_geom) AS the_geom
FROM
(
SELECT the_geom FROM middleline
UNION ALL
SELECT the_geom FROM topline
UNION ALL
SELECT the_geom FROM bottomline
UNION ALL
SELECT the_geom FROM oneline
UNION ALL
SELECT the_geom FROM twoline
UNION ALL
SELECT the_geom FROM threeline
UNION ALL
SELECT the_geom FROM fourline
UNION ALL
SELECT the_geom FROM fiveline
UNION ALL
SELECT the_geom FROM sixline
) AS alllines
)
SELECT
chp04.polygonize_to_multi(ST_Rotate(the_geom,
$2, $1)) AS the_geom FROM combined
;
$$ LANGUAGE SQL;
How it works...
Thisfunction,shownintheprecedingsection,essentiallydrawsthegeometryfrom
a single input point and rotation value. It does this using nine instances of
ST_MakeLine . Typically, one might use ST_MakeLine in combination with
ST_MakePoint to accomplish this. We bypass this need, however, by having
the function consume a point geometry as an input. We can, therefore, use
ST_Translate tomovethispointgeometrytotheendpointsofthelinesofinterest
in order to construct our lines with ST_MakeLine .
Search WWH ::




Custom Search