Commit 7cfdf4c0 authored by Eric Duminil's avatar Eric Duminil
Browse files

Whole BW

parent 608f73c0
...@@ -12,6 +12,8 @@ Required: ...@@ -12,6 +12,8 @@ Required:
* pyproj project (https://pypi.org/project/pyproj/) * pyproj project (https://pypi.org/project/pyproj/)
* SimStadt installed on the Desktop (for RegionChooser) * SimStadt installed on the Desktop (for RegionChooser)
Data license: https://www.govdata.de/dl-de/by-2-0
Eric Duminil, 2025 Eric Duminil, 2025
""" """
from pathlib import Path from pathlib import Path
...@@ -34,12 +36,15 @@ from shapely.geometry import Point ...@@ -34,12 +36,15 @@ from shapely.geometry import Point
from get_coordinates_by_zipcode import get_coordinates_by_zipcode from get_coordinates_by_zipcode import get_coordinates_by_zipcode
from german_laender_wkt import german_laender
COORDINATES_REGEX = re.compile(r"(\-?\d+\.\d*) (\-?\d+\.\d*)") COORDINATES_REGEX = re.compile(r"(\-?\d+\.\d*) (\-?\d+\.\d*)")
###### User input ########## ###### User input ##########
# Values can be either a WKT POLYGON or MULTIPOLYGON, a Zipcode, or Zipcodes separated by a comma. # Values can be either a WKT POLYGON or MULTIPOLYGON, a Zipcode, or Zipcodes separated by a comma.
REGIONS = { 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))", "BW": german_laender['Baden-Württemberg'],
# "Freiburg": "79098,79102", # "Freiburg": "79098,79102",
# "AnotherRegion": "Another WKT Polygon...", # "AnotherRegion": "Another WKT Polygon...",
# "YetAnotherRegion": "Another ZIP code", # "YetAnotherRegion": "Another ZIP code",
...@@ -120,6 +125,7 @@ def download_whole_region(output_dir: Path, wkt_region: str, x1: int, x2: int, y ...@@ -120,6 +125,7 @@ def download_whole_region(output_dir: Path, wkt_region: str, x1: int, x2: int, y
if local_region.distance(tile_center) > RASTER * KILOMETER: if local_region.distance(tile_center) > RASTER * KILOMETER:
continue continue
citygml_zip = f"LoD2_{UTM}_{x}_{y}_{RASTER}_{BUNDESLAND}.zip" citygml_zip = f"LoD2_{UTM}_{x}_{y}_{RASTER}_{BUNDESLAND}.zip"
# Oh, zip was deleted, but GML was here
citygml_url = f"{CITYGML_SERVER}/{citygml_zip}" citygml_url = f"{CITYGML_SERVER}/{citygml_zip}"
local_zip = output_dir / citygml_zip local_zip = output_dir / citygml_zip
if local_zip.exists(): if local_zip.exists():
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment