GeoPython 2023

A guide on using OSMnx and geopandas to extract and manipulate OpenStreetMap data
2023-03-07, 10:45–11:15, Auditorium

A look at the process of extracting and loading OpenStreetMap building footprints into PostGIS using OSMnx and Geopandas. This talk will cover our particular use case and the workflow we used.


At addresscloud we have used OpenStreetMap building data in our main application for the UK but we’ve recently found the need to get this data on a global basis. Our main goal was to extract the building outlines that have been captured in OSM and push these into our datastore to use in our applications. We didn’t want to do this for a whole country as the amount of data and time to upload could be costly. We looked at a few different solutions but wanted something that was easy to set up and use so went with the python library OSMnx.
OSMnx is a Python package to retrieve, model, analyse, and visualise street networks and other geometries from OpenStreetMap. In a single line of code, OSMnx lets you download spatial geometries, place boundaries, buildings footprints, or points of interest as a GeoDataFrame.
This talk will look at the different options available in terms of downloading the data .i.e by city name, polygon, bounding box, or point/address plus distance. It will then show how we added geopandas into the workflow to export the data for use in our wider ecosystem. Finally we will look at the whole workflow and show how easily you can use OSMnx and geopandas in real world applications. Example code snippets will be shown for people to get an idea of how they can make use of OSMnx.