I'm trying to get the overal time and distance from a routing in pgRouting, using pgr_dijkstra, but I have basically no idea on how to achieve it. So far I managed to figure out that the return from pgr_dijkstra is in cost units and I summed them up. I assume that calculating distance and time is actually done per segment in the route. Does someone have an example on how to do this?
SELECT SUM(cost)
FROM (SELECT cost
FROM pgr_dijkstra('SELECT u_gid as id,
u_source AS source,
u_target AS target,
cost AS cost,
reverse_cost
FROM ways', 78771, 26263, true, true)) AS r_cost;
The statement above will give me the sum of all the unit costs...