0

I'm using pgRouting to find the least congested path using time as the cost metric. I am using average speed between two nodes to calculate time taken to travel in a segment. In pgRouting there is a forward cost and reverse cost. I have created tables to each and every edge to maintain reverse and forward speeds. How can I recognize whether a vehicle is travelling in forward direction or the reverse direction in sever side? I'm using postgreSQL as my database

1 Answer 1

1

Normally the direction is determined by the order of the coordinates in the linestring.

(You pass the first coordinate before going to the second)

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.