I created a routing network based on OSM with OSM2PO in PostgreSQL with the extension pgrouting. I have got a column km
(distance in km), a column cost
(driving time) and max_speed
. I try to create a catchment with the function pgr_drivingDistance using the column km
(distance in km). This calculates a catchment with the shortest path, which is in most cases not a realistic distance for cars. Therefore I want to calculate the catchment based on the shortest driving time using cost
. But in the result, I need units of meters and not time. Many thanks for any hint.
Short version: I need a catchment with distances in km for the fastest (min time) route!
Here is the standard code for pgr_drivingDistance with shortest distance in km:
SELECT *
FROM routing_vertices_pgr
JOIN(
SELECT * FROM pgr_drivingDistance('
SELECT id,
source,
target,
km as cost
FROM routing',
1, 100, false)) AS route ON routing_vertices_pgr.id = route.node ;