[GIS] How to create a pedestrian routing graph from OSM

openstreetmaposmosisrouting

I am interested in obtaining the foot paths from OSM data. Specifically I consider the area within the city limits of Berlin. I downloaded the corresponding OSM file from Geofabrik and I intend to use osmosis to filter the data. As a first step I would like the ways which are usable by pedestrians. I have started out with this:

osmosis --read-xml file=berlin-latest.osm.bz2  --tag-filter accept-ways highway=footway --used-node --write-xml file="berlin-foot.osm"

However, I am not sure about when the tags footway and pedestrian. Essentially I want to end up with a graph so I can perform routing tasks. Will I need both relations in this case? Also, at least the pedestrian highways seem to sometimes contain "area=yes" tags. Can I filter on the way type as well?

Edit: I would like all the ways which can be used by pedestrians, I don't want to restrict myself to pedestrian-only ways. My current version is this:

INPUT="berlin-latest"

osmosis --read-xml file="${INPUT}.osm.bz2" \
 --tag-filter accept-ways highway=footway,pedestrian,path,track \
 --tag-filter reject-relations --used-node --write-xml file="${INPUT}-foot.osm.bz2"

osmosis --read-xml file="${INPUT}.osm.bz2" \
 --tag-filter accept-ways highway=* \
 --tag-filter accept-ways sidewalk=both,left,right,yes \
 --tag-filter reject-relations --used-node --write-xml file="${INPUT}-sidewalk.osm.bz2"

osmosis --read-xml file="${INPUT}.osm.bz2" \
 --tag-filter accept-ways highway=residential,unclassified,living_street \
 --tag-filter reject-relations --used-node --write-xml file="${INPUT}-residential.osm.bz2"

osmosis --read-xml file="${INPUT}-sidewalk.osm.bz2" \
 --read-xml file="${INPUT}-foot.osm.bz2" \
 --read-xml file="${INPUT}-residential.osm.bz2" \
 --merge --merge --write-xml file="${INPUT}-pedestrian.osm.bz2"

This seems reasonable, although I am still uncertain regarding area tags. Also I might remove the access=private ways. Another problem is that some highways are missing their sidewalk tags, so some more mapping would have to be done…

Best Answer

highway=footway is used for paths between roads or through parks. highway=path is used in a similar way (with some debate) for smaller paths that are unpaved but have been worn into grass.

highway=pedestrian is used for wide roads that have been "pedestrianised" so vehicles are not allowed to drive down them (except maybe for deliveries). They are also used for areas such as plazas, with the addition of an area=yes tag. An example is by Bradenburger Tor. http://www.openstreetmap.org/way/38210407#map=18/52.51628/13.37865

Routing over pedestrian areas is a different case, you can hope someone has also mapped footways/cycleways across the area, like they have here. Otherwise you might want to do some additional work in your routing system to say you can navigate from any point on the edge, in a straight line to any other point on the edge. An example is if you go West through the gate/tor, you don't have to follow the cycleway to the road you can immediately turn right and head North over the plaza to make a shortcut joining Erbertstrasse and get to Dorotheenstrasse.

To get all pedestrian-acceptable ways I would start with all highway values (pedestrians are so versatile!) and then adjust your rules to include exceptions. highway != motorway AND highway != motorway_link might be enough as far as I can think of right now. As you mentioned, also add a clause for appropriate access restrictions. http://wiki.openstreetmap.org/wiki/Key:access

OpenStreetMap is great for it's richness of community-created data, but this does mean a lot of tags to consider. Remember to have a scan look at your data or a place you know well. If there is something you deem wrong, see how it is m

Related Question