Database Reference
In-Depth Information
Finally, we construct the line as a polygon using ST_MakePolygon . This requires
adding the starting point by executing ST_StartPoint in order to properly close
the polygon. The complete code is as follows:
WITH alphashape AS (
SELECT pgr_alphaShape('
WITH DD AS (
SELECT seq, id1 AS node, cost
FROM pgr_drivingDistance(
''SELECT id, source, target, cost FROM
edge_table'',
6, 1.5, false, false
)
),
dd_points AS(
SELECT id, x, y
FROM vertex_table w, DD d
WHERE w.id = d.node
)
SELECT * FROM dd_points
')
),
alphapoints AS (
SELECT ST_MakePoint((pgr_alphashape).x,
(pgr_alphashape).y) FROM alphashape
),
alphaline AS (
SELECT ST_Makeline(ST_MakePoint) FROM
alphapoints
)
SELECT ST_MakePolygon(ST_AddPoint(ST_Makeline,
ST_StartPoint(ST_Makeline))) FROM alphaline;
Our first driving distance value is not too interesting, but it can be with real data
asinthe Calculating demographics using driving distance recipe.Seethefollowing
screenshot:
Search WWH ::




Custom Search