Hi everyone, When I export the .osm data, I'd like it to give me only roads that cars can actually drive on if possible? At the moment it's giving me buildings, walking paths in the middle of parks and all sorts. Is there a quick fix for this? Not all nodes have tags which state whether they are highways so actually going through them one by one would be painful... Thanks! asked 12 Feb '14, 22:58 Kyanite |
To know which highway tags are important for cars, have a look at these wiki pages: As a start point, you should select ways (and only ways, not nodes) with: The tag "access" is important (the legal status). Absence of access tags means "allowed". Otherwise, look if "motor_vehicle=yes|no" or "motorcar=yes|no" is present. Otherwise, look for a general access definition like "access=yes|permissive" for "allowed" or "access=private|delivery|emergency|forestry|no" for "disallowed". If you care about direction, check the tag oneway=yes|-1|no or junction=roundabout answered 13 Feb '14, 13:07 Pieren 2
I'd add one caveat to that, where it says 'Absence of access tags means "allowed"': The meaning of the absense of an access tag is very dependant on context. If it's in an area in which it's clear that all of the access rights have clearly been surveyed by people on the ground, then it might well mean that. However, if it's a rural area where data has come from aerial imagery, it actually means "not yet known". For example in England I wouldn't assume that I had legal motor vehicle access to a highway=track unless it had an approriate access tag.
(13 Feb '14, 13:47)
SomeoneElse ♦
1
There are also implicit default access values which should be used whenever there are no access tags present. But as already explained by SomeoneElse a missing access tag doesn't always mean that the default access restrictions apply. It could also indicate that nobody has checked the legal access status yet.
(13 Feb '14, 14:06)
scai ♦
Even with surveyed roads, nobody is adding an explicite "access=yes" tag to all created highways. Probably because the access tag reflects a road sign most of the time. And in absence of road signs, "what is not forbidden is allowed".
(13 Feb '14, 14:26)
Pieren
1
"what is not forbidden is allowed". In some countries perhaps; most certainly not in others. :) The point about implicit access rules saying things like "you are allowed to drive on a highway=primary" is well made; no-one is suggesting tagging them all with "motorcar=yes". However, the point that I was trying to make was that anyone extracting highway data from OSM has to think about how it got there, and how much information is missing (because it's just never been surveyed) from what they've extracted.
(13 Feb '14, 14:34)
SomeoneElse ♦
1
This is true but not only for access tags, for all attributs in OSM in general.
(13 Feb '14, 15:48)
Pieren
showing 5 of 6
show 1 more comments
|
An easy way to get predefined data is the Overpass API with its user friendly tool Overpass Turbo. hth answered 13 Feb '14, 17:10 malenki 1
You forgot to exclude highway=steps :) And depending on the use-case one could exclude highway=construction, too. And nodes which have a highway tag but aren't part of a way with a highway tag, such as highway=bus_stop.
(13 Feb '14, 18:41)
scai ♦
yes - thanks for the addition
(13 Feb '14, 18:45)
malenki
|
You don't say what program you're feeding the OSM data into. Usually, any such filtering would be done by this "client" program. For example, if you were using a renderer such as Mapnik, you would write a stylesheet that only uses the highway= tags. answered 13 Feb '14, 00:58 Richard ♦ |
I guess using osmfilter (read the section about Object Filter) afterwards is a good option as I do not know of the osm.org export being able to filter server-side. However, thirdparty services may help too (e.g. overpass turbo could be an option). It depends on your usecase what is best. answered 12 Feb '14, 23:28 aseerel4c26 ♦ |
It seems like a lot of work has gone into the Car routing profile for OSRM. It would be great if there was a way to use this as the input and get the corresponding roads that it considers drivable. https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/car.lua answered 01 Sep '21, 18:32 chrowe |
Update: I have discovered OSMFilter, however am unsure how to filter just roads and remove everything else!
--keep="highway=" I'm assuming I will need this, however how can I drop all other non-vehicle roads?
Please ask a new question about osmfilter (if you cannot find it in the previous questions). however, I think it should be clear on the wiki page: you need to filter for tags (not only keys). Note: I did not use this tool on my own.
One thing to think about - what do you consider a road that cars can drive on? A "highway=footway" obviously isn't, and a "highway=primary" obviously is, but what about "highway=track"? Also you may want to think about "access" tags.