Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have built a network using Ordnance Survey's ITN data and I can solve routes across the network. What I need is to build in grade separation topology for overpasses and underpasses on the network so that my routing solutions do not drop off bridges onto roads underneath in an attempt to make the shortest path possible. Does anyone have any pointers as to where to start?

I am using PostGIS 2.0.3, pgRouting 1.0.7dev and Postgresql 9.2 on Windows.

share|improve this question
    
@tqhien - thanks for the suggestions. I will look at my network table and pgRouting 2 and let you know if I have any success. –  mixedbredie Aug 14 '13 at 11:31
    
@uffe - I will look at RW Net 4 if I can't get pgRouting to do what I need it to. –  mixedbredie Aug 14 '13 at 11:32
add comment

2 Answers

When loading data to PostGIS, there's no topology information associated with them. To create a useful topology the data needs to be “noded”. This means that where two or more roads form an intersection there it needs to be a node at the intersection and all the road segments need to be broken at the intersection, assuming that you can navigate from any of these segments to any other segment via that intersection. (Extract from pgrouting 2.0 documentation).

In your case, it seems that some nodes are common between bridges over roads and underneath roads. I don't know if those nodes were given in the ITN data or if you created them.

So you have to pass a clean network to pgrouting :

Let's say you have a bridge (A-B-C) and a road underneath (D-B-E) :

Network example

The table you pass to pgRouting is like :

source | target | geometry           | cost
   A   |   B    | LINESTRING (A,B)   | cost_ab
   B   |   C    | LINESTRING (B,C)   | cost_bc
   D   |   B    | LINESTRING (D,B)   | cost_db
   B   |   E    | LINESTRING (B,E)   | cost_be

You have to modify it to

source |target | geometry            | cost
   A   |   C   | LINESTRING (A,B,C)  | cost_ab+cost_bc
   D   |   E   | LINESTRING (D,B,E)  | cost_db+cost_be

You can create a temporary table and use some case statements to fill columns/filter your grade and generate the modified network.

Note that pgRouting 2.0 documentation gives an example (but with new methods) : pgRouting 2.0 Routing topology

share|improve this answer
    
olg pgRouting function assign_vertex_id works correctly if our data is "correct", it uses only start and endpoints for edge/node table generation. One could assume that current version works same way. Offcourse if you have bad data , its problem. If you have 3d data you can try use it to clean / merge roads to longest "correct" linestring –  simplexio Aug 2 '13 at 12:20
add comment

If unsupported by pgRouting, our RW Net 4 package can handle grade separations or Z-levels as they are also called. We also offer an ITN converter for easy import.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.