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.

Is it possible to prevent road segments being used when these are blocked by bollards, concrete blocks or the like?

I have one example where there the road Solhøjvej is blocked with a so called concrete block as you can see here

http://www.openstreetmap.org/?lat=57.010248&lon=9.936238&zoom=18&layers=M

Here is a photo of the "block":

https://maps.google.com/?ll=57.010343,9.934331&spn=0.000929,0.00284&t=m&layer=c&cbll=57.010252,9.934346&panoid=SrWxGTFwoDbDZeDgXHl8vg&cbp=12,10.73,,0,10.62&z=19

I’m exporting the Openstreetmap to PostgreSQL using osm2po and performs routing, but this does not know of these concrete blocks or bollards or stuff blocking the road.

I’m aware that this is perhaps not a simple task, to detect and split road segments when such obstacles occur, but that would be very useful. Am I just missing an option?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Yes, it's possible. But osm2po only takes barrier=bollard into account by default. If you need other types of barriers you'll have to use Java in order to override DefaultNodeTagResolver.isBarrier(). For pgRouting this information can be retrieved from the Vertex-Table which is not written by default, but can be activated by setting postp.1.class=de.cm.osm2po.plugins.PgVertexWriter in the config. Once created look for clazz < 0 in the table. Additionally setting sth. like nodeClazz.-128.name=Barriers in the config or on the commandline visualizes them in the WebTestUI (see below)

In osm2po barriers are handled like turn restrictions and must be explicitly activated by setting graph.support.barriers=true.

bollard-barries in Hamburg

share|improve this answer
    
Very exciting, I'm having a look at it now :) I'll get back. –  xcalibur666 Apr 5 '13 at 9:56
1  
Fantastic, I got it working. Now I both load bollards and concrete blocks. I did as you said and implemented my own nodetagresolver and it is working like a charm. Thank you for your help, this is VERY usefull! –  xcalibur666 Apr 5 '13 at 11:20
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.