0

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?

3
  • So what are the attributes of the missing roads that you have found?
    – JGH
    Commented Sep 26, 2023 at 13:39
  • I also use route='road' (which can be found with a null highway) and filter out some of the highway sub-type (like raceway, pedestrian paths, steps, bike path etc)
    – JGH
    Commented Sep 26, 2023 at 13:41
  • usually they tend to be service road but not always. Commented Sep 27, 2023 at 20:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.