I wnat to extract all the road types and speed limits from the OSM file for the US. I started with a small subset (Delaware OSM), and I ran the following query to try to get rid of unnecessary information using the osmosis/osmfilter command.
bin/osmosis --read-xml delaware.osm --tf accept-ways highway=* --used-node --write-xml delaware_highways.osm
This is removing too much information. I used the OSMNX Python library, which has a function called osmnx.nearest_edges. You give it a latitude, longitude) point, and it will return the nearest edge of the graph based on that point. Out of 500 (latitude, longitude) points I test to find the nearest edge, 35 road types are missing on the graph output of this query.
What am i doing wrong in my query to filter for only roads and highways using osmosis/osmfilter in my OSM file?
route='road'
(which can be found with a nullhighway
) and filter out some of thehighway
sub-type (like raceway, pedestrian paths, steps, bike path etc)