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 am struggling with the data format OSM gives me: I want to use OSM data for routing, but all round-abouts and parking lots are not in the lines layer. They are situated in the poly(lines) layer.

Thus I could not find a working way to combine both layers by their same type (e.g. highway=secondary) to have the roundabouts in place for valid routing.

I imagine that this is quite a easy one, but I am stuck. can someone help me out?

Frank.


After v.patch I added my stations to the network and added missing nodes

v.net --overwrite --verbose input=network points=stations output=network_tmp operation=connect thresh=500
v.net input=network_tmp operation=nodes output=network

BUT if I now want to do routing, I still get a lot of errors saying that the points are not reachable from each other. On the network itself it looks ok.

echo 2 2 4 |v.net.path --overwrite --verbose input=network output=path_2_4

I tried a cleanup as found on the web

v.clean input=network output=network_cleaned tool=break,rmdupl

This does not improve the routing. As the manual says it breaks the lines at each line intersection and therefore all information regarding bridges, tunnels etc. are lost.

Any idea why it is that hard to use openstreetmap data or are my steps wrong?

share|improve this question
add comment

2 Answers 2

You can extract types with v.extract and then patch them with v.patch.

share|improve this answer
add comment

I used now as before

v.extract input=lines@PERMANENT output=streets@PERMANENT where=highway='living_street' or highway='service' or highway='pedestrian' or highway='primary' or highway='residential' or highway='secondary' or highway='track' or highway='secondary_link' or highway='tertiary' or highway='tertiary_link' or highway='motorway' or highway='road' or highway='motorway_link' or highway='trunk' or highway='trunk_link' or highway='primary_link'
v.extract input=poly@PERMANENT output=junctions@PERMANENT where=highway='living_street' or highway='service' or highway='pedestrian' or highway='primary' or highway='residential' or highway='secondary' or highway='track' or highway='secondary_link' or highway='tertiary' or highway='tertiary_link' or highway='motorway' or highway='road' or highway='motorway_link' or highway='trunk' or highway='trunk_link' or highway='primary_link'

and then

v.patch input=junctions,streets output=network --overwrite

seems to work now. Thanks for your help!

Frank

share|improve this answer
    
Please upvote markusN's answer to give something back for helping you. –  underdark Aug 14 '12 at 7:43
    
Hi underdark, I also read your tutorial about Finish airports and the use of QGIS/pgrouting. Have you ever tried this with OSM data? In my case pgrouting and the GRASS way do not find reliable routes on the OSM road network. Maybe it is OSM quality related? –  Frank Aug 15 '12 at 11:27
    
OSM is not routable by default. It needs quite a lot of preprocessing (e.g. splitting road lines at intersections but not at under or overpasses). For PostGIS, I've been using osm2po to make OSM routable. –  underdark Aug 15 '12 at 11:30
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.