1

I have been experimenting with generating isochrones with pgrouting using osm data. So far, I have been able to generate isochrone polygons by getting the concave hull of the nodes returned from the pgr_drivingdistance function. Here is a sample query to generate 10 minute (0.166667 hr) isochrone from node 46397, assuming a speed of 5km/h :

SELECT 1 AS id, st_concavehull(st_union(t.the_geom), 0.95)
FROM
(SELECT seq, id1 AS node, id2 AS edge, cost, pt.the_geom AS the_geom
  FROM pgr_drivingdistance(
    'SELECT id, source, target, (km/5) as cost FROM at_2po_4pgr',
    46397, 0.166667, FALSE, FALSE
  ) AS di
  JOIN at_2po_4pgr_vertices_pgr pt
  ON di.id1 = pt.id) t

Which yields the following isochrone :

10 min isochrone at 5kmh from node 46397

I would like to know if it is possible to calculate an isochrone while considering the possibility of reaching points along a portion of each edge? This would be especially useful in cases where network edges are very long. For example, the pgr_drivingdistance function would return a point 50% along an edge, if only half of the edge could be traversed.

1 Answer 1

2

I ended up solving this problem with the following function:

networkreachpartial

Here is an example which generates a 10 minute (0.166667 hr) isochrone from node 46397, assuming a speed of 5km/h:

CREATE TABLE networkreachpartial_node_46397_walk_5kph
AS
(SELECT 1 as id, ST_ConcaveHull(st_union(t.geom), 1)
FROM
(select *
from networkreachpartial2('at_2po_4pgr', 'cost_walk_5kph', 'geom_way', array[46397], 0.166667)) t)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.