While doing the pgrouting to find the shortest distance I got success in getting the output but when I thought to come up with the time consumed for travelling, I cannot find the proper source to get the time consumed.

If there is a solution, can you let me know about the function to be used for that in pgrouting?

  • You add up the cost of the links returned. – John Powell May 29 at 12:12
  • most functions in pgRouting list (and aggregate) the cost column value for each segment traversed, and use that, of course, to determine the most efficient route. e.g. if you pass in the segment length as cost, the result will be the 'shortest route', as in 'minimum total length'. sth. like segment length / max speed as cost would approximate a 'fastest route', returning the 'total minimum travel time' – ThingumaBob May 29 at 12:27
  • I got the minimum travel time successfully but is there any possibility to return both the distance and time spontaneously. – Karthik Jun 5 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.