Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
Get Baden-Württemberg CityGML Opendata
Commits
7cfdf4c0
Commit
7cfdf4c0
authored
Sep 11, 2025
by
Eric Duminil
Browse files
Whole BW
parent
608f73c0
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
download_files_from_LGL_BW.py
View file @
7cfdf4c0
...
@@ -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
():
...
...
german_laender_wkt.py
0 → 100644
View file @
7cfdf4c0
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment