Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a way to consider a more complex cost field in the PG_Routing algorithm?

I am currently trying to get more realistic routing costs. I have a map based on the German ATKIS standard with road types given. I have also the max. speed on those roads. @Editors: Can someone add a tag "ATKIS" for the German standard?

Idea:

  1. Based on Identifying road intersections using PostGIS I am able to identify all junctions.

  2. Now, combine the junction information with the vehicle acceleration to estimate the max. speed on the edge.

  3. Would yield the indvidual costs for every edge

Can someone help me to solve issue 2.?

Or, is this impossible (or not necessary)? Maybe I am on the wrong track to get realistic traveling times!?

EDIT:

I successfully combined the junction information with the routing information. However, I might still have an error since I neglected the direction of the graph and thus which junction to take (start or endpoint of the edge).

Here's the code. Nervertheless, leave me a message if sth. can be solved better:

SELECT a.vertex_id, a.edge_id, a.cost, b.crossing, b.array_agg, 
b.count, c.length, "WDM"
FROM shortest_path('
 SELECT gid AS id,
  start_id::int4 AS source,
  end_id::int4 AS target,
  length::float8 AS cost
 FROM network',
 2302,
 1496,
 false,
 false) as a, junctions as b, network as c
 WHERE c.st_endpoint = b.crossing AND c.gid = a.edge_id
share|improve this question
just an idea. How about calculating all turns on route as change of azimuth and classify those to 2-4 different class and add some educated quess to totaltime. – simplexio Feb 25 at 10:49

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.