Roads and Buildings SHP Parser
This script allows us to parse buildings and roads polygons from Open Street Map. It makes use of the OSMnx package to obtain these polygons, and export them into a local directory so that it can be used for further analysis.
Instructions
Install the OSMnx package (the use of its conda environment is strongly suggested).
Run the exportRoadAndBuildings.py script to parse the shapefiles for a particular lat-long coordinate:
source activate osmnx
python exportRoadAndBuildings.py "PLACE_NAME" lat long dist
Where the “PLACE_NAME” is an arbitrary tag defined by the user to name the output files.
This will generate folders within the SHP path. These folders will contain the buildings and roads shapefiles for the requested location (a preview of the area will also be exported to the images folder).
- SHP folder contains the shapefiles for buildings and roads
- NTW contains the network (graphml) files for roads
Examples
python exportRoadAndBuildings.py "YorkeysKnob" -16.8134 145.7168 1750
python exportRoadAndBuildings.py "Comoros" -11.7167 43.4296 1000
Requirements
These scripts require OSMnx installed.
Authors
Héctor M. Sánchez C.