Database Reference
In-Depth Information
How to do it...
In order to perform basic skeletonization, we'll calculate Voronoi polygons on the
nodesthatmakeuptheoriginalstreampolygon.TheedgesofVoronoipolygons,by
nature,findthelinethatdemarcatesthemidpointbetweenpoints.Wewillleverage
thistendencybytreatingourlineslikepoints—addingextravertexestothelinesand
thenconvertingthelinestoapointset.Thisapproach,incombinationwithVoronoi,
will provide an initial estimate of the polygon's centerline.
Wewilladdextrapointstoourinputgeometriesusingthe ST_Segmentize function,
and then convert the geometries to points using ST_DumpPoints :
CREATE TABLE voronoi_points AS
WITH rawpoints AS (
SELECT
(ST_DumpPoints(ST_Segmentize(the_geom,
5))).geom AS the_geom FROM voronoi_hydro
UNION ALL
SELECT
(ST_DumpPoints(ST_Extent(the_geom))).geom AS
the_geom FROM voronoi_hydro
Search WWH ::




Custom Search