Posted on 27th April 2017
I'm currently working on using some address information from open street map to augment other open data sources. Here are some notes on using data from open street map, in Python.
It seems like this is a bit of a pain. Open StreetMap (OSM) uses a custom, XML based, format which is hard/impossible for standard GIS software to read.
OSMnx
package seems great for making direct, small-scale queries.)http://download.geofabrik.de/ Offer downloads of regions of the world, either in OSM format, or converted to shape-file format. The latter can be loaded into geopandas, QGIS etc. etc. but appears, sadly, to be missing useful information. For example, I can locate a building and find the polygon for this (by it's ID) in the shapefile, but there is no meta-data attached to give me e.g. the address!
However, for off the shelf analysis using existing tools, this is perhaps where to start.
The standard format is XML, either compressed, or packaged using Protobuf.
I should probably be using pyOsmium but there is no conda build, and being stuck with either a windows box, or a locked-down linux box, I am scared to try to get it to build.
GDAL / OGR can be easily installed (or come for free with geopandas).
It seems that others have had similar thoughts to me. OSMnx looks to be a great tool for network analysis of road networks. The review paper is also very informative, with some nice background information.
With Anaconda, it's a one-line install:
conda install -c conda-forge osmnx
This seems very nice for targeted downloads, but it's a bit too "magic" for my tastes. The source code is very readable however, and I've been learning a lot from it.