I am thinking about extracting my data processing code out of my main codebase, in order to share it around. In the meantime, this Gist contains the code that extracts Street and Node data out of OSM files.
There’s a whole World Of Process™ that occurs around these scripts:
- collect
.polyfiles for Cities within Regions within a Country - extract
.osm.pbffiles out of a Region’s.osmfile - convert the
.osm.pbffile to.osmfile -
then run the two scripts linked above to create two
.jsonfiles (one containing Streets and the other containing Nodes) - then there’s another piece of code to import the data from the
.jsonfiles into the database
However, the piece that you’re discussing - ignoring certain data types within the Region’s .osm file - is all within the two scripts linked at the top of this post.
…Anyway… Follow the two links at the top of that Gist, because the person who wrote the code (I just modified it a little bit in order to collect Street and Node data) goes into more detail on the process.