Get Baden-Württemberg Opendata
Since June 2024, LoD2 CityGML files are available from Baden-Württemberg Opendata at https://opengeodata.lgl-bw.de/#/ .
The server contain 3D models for whole Baden-Württemberg, but it only allows to download 2 tiles at most from the web interface. Zip files need to be extracted, merged into each other, and cut to the desired region.
This script automates the whole process. All is needed is a name and a region, either specified as a WKT polygon or a Zipcode.
Multiple regions can be defined:
REGIONS = {
"StuttgartCenter": "POLYGON((9.175287 48.780916, 9.185501 48.777522, 9.181467 48.773704, 9.174429 48.768472, 9.168807 48.773902, 9.175287 48.780916))",
"Freiburg": "79098,79102"
}
Requirements
- Python
- pyproj (https://pypi.org/project/pyproj/), requests, shapely.
- SimStadt/RegionChooser (https://simstadt.hft-stuttgart.de/getting-started/install-software/)
Usage
- In order to be sure dependencies are installed, you can run
pip install -r requirements.txt
insideget-bw-opendata
folder. - Specify desired regions in REGIONS inside
download_files_from_LGL_BW.py
:- as WKT Polygon (https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry). For example from https://wktmap.com/
- as a ZipCode (e.g.
"70567"
) - or a list of Zipcodes, separated by a comma (e.g.
"79098,79102"
)
- Run
download_files_from_LGL_BW.py
. - Zip and CityGMLs files should be saved in corresponding subfolders, e.g. "StuttgartCenter.proj"