Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Extracting building footprints from OpenStreetMap
This guide is about extracting building footprints as a Shapefile of polygons from the OpenStreetMap dataset, in order to use them as input for 3dfier.
Download OSM data
First, you need to download the OSM data for your area of interest:
Through your browser, visit the OpenStreetMap website
Zoom at the area you want to work on
Exportbutton on the top
From the left panel, you may select to further specify the area you want to download (via the
Manually select a different areaoption)
When finished, press the
Exportbutton from the left panel.
You should be asked to download an
.osm file. Just store it somewhere on your computer.
Extract buildings through QGIS
Originally, the data from OpenStreetMap are just geometries with key-value pairs assigned to them. You can easily filter the buildings from all geometries inside an
From the menu, select
Add Vector layer....
.osmfile with the area downloaded.
When prompted about the layer you want to add, you can only select the
multipolygonslayer (it's OK if you add all of them, but buildings are on this layer).
Layers Panel, right-click on the multipolygons layer you've just added and select
On the dialog, provide the following expression:
"building" is not null(essentially, what that means is that all polygons without a building key, will be filtered out). You should now see only the buildings on the map.
Layers Panel, right-click on the multipolygons layer, again, and now select
On the dialog, select the
ESRI Shapefileformat and provide the output file. You may also want to reproject the geometries on another CRS, now, if the elevation data you are going to use on 3dfier are not on WGS 84 (EPSG:4326).
When you save, you should have a shapefile with footprint of the buildings for this area, at the CRS you specified. You can use this, now, as an input for 3dfier.