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
.poly
files for Cities within Regions within a Country - extract
.osm.pbf
files out of a Region’s.osm
file - convert the
.osm.pbf
file to.osm
file -
then run the two scripts linked above to create two
.json
files (one containing Streets and the other containing Nodes) - then there’s another piece of code to import the data from the
.json
files 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.