You are not logged in.

#1 2021-03-30 11:01:33

icemanXVI
Member
Registered: 2018-11-05
Posts: 6

Extract only buildings data with Python

Hi, I would like to extract only building data (with an API in python).
My intention is to choose an area (with a bounding box) and extract only the buildings. Then I will need the 3D of the buildings in OBJ format (but it's the next step)

Is such a thing possible in Python?

Thanks smile

Offline

#2 2021-04-03 13:43:29

Tordanik
Moderator
From: Germany
Registered: 2008-06-17
Posts: 2,652
Website

Re: Extract only buildings data with Python

Extracting building data from OSM is relatively easy – I suspect that Overpass API will suit your needs. You should be able to find Python bindings for that.

Producing 3D buildings from OSM is a different level of complexity. I don't know a solution for Python, but feel free to look into OSM2World for your needs. Getting the output into Python is going to be a little inconvenient, but it's a small step compared to the complexity of converting OSM data to OBJ in the first place.


OSM in 3D: OSM2World

Offline

#3 2021-04-06 09:46:44

icemanXVI
Member
Registered: 2018-11-05
Posts: 6

Re: Extract only buildings data with Python

Hi Tordanik,
thanks for your reply. So far I have been using OSM2World to convert my OSM files; but I'm builting an application in Python and I would like to download and create 3D buildings without external tools (and in Python environment).

The way I'm trying now is to download the OSM file via the overpass-api and convert it via osm2geojson to GeoJSON file. Then I will extrude the footprint of the buildings.

I'm aware of the limitations of this procedure but at least it's a first (small) step.

Updates will follow...

Bye-bye wink

Offline

Board footer

Powered by FluxBB