Database Reference
In-Depth Information
Ifyoulookcloselyattheprecedingscreenshot,youwillseethebasiccenterlineex-
tant in our new data. Now, we take step one toward extracting it. We should index
ourinputsandthenintersecttheVoronoioutputwiththeoriginalstreampolygonin
ordertocleanthedatabacktosomethingreasonable.Intheextractionprocess,we'll
also extract the edges from the polygons and remove the edges along the original
polygoninordertoremoveanyexcesslinesbeforeourroutingstep.Thisisimple-
mented in the following script:
CREATE INDEX chp04_voronoi_geom_gist
ON public.voronoi
USING gist(the_geom);
DROP TABLE IF EXISTS voronoi_intersect;
CREATE TABLE voronoi_intersect AS
WITH vintersect AS (
SELECT
ST_Intersection(ST_SetSRID(ST_MakeValid(a.the_geom),
3734), ST_MakeValid(b.the_geom)) AS the_geom
FROM
voronoi a, voronoi_hydro b
Search WWH ::




Custom Search