Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SimStadt
Germany Open-Data CityGML
Commits
30310361
Commit
30310361
authored
Nov 03, 2025
by
Eric Duminil
Browse files
Escape URL
parent
1e151f09
Changes
1
Hide whitespace changes
Inline
Side-by-side
07_hessen.py
View file @
30310361
# https://gds.hessen.de/INTERSHOP/web/WFS/HLBG-Geodaten-Site/de_DE/-/EUR/ViewDownloadcenter-Start?path=3D-Daten/3D-Geb%C3%A4udemodelle/3D-Geb%C3%A4udemodelle%20LoD2
import
json
from
datetime
import
datetime
from
urllib.parse
import
quote
from
citygml_download
import
TMP_DIR
,
Bundesland
,
CityGMLWithDate
,
download_all_files
,
download_file
...
...
@@ -20,20 +20,21 @@ if __name__ == "__main__":
data
=
json
.
load
(
json_file
)
citygmls
=
[]
for
kreis_link
in
data
[
'
navigation
'
]:
if
'
LoD2
'
in
kreis_link
[
'
uri
'
]
and
kreis_link
[
'
level
'
]
==
4
:
for
kreis_link
in
data
[
"
navigation
"
]:
if
"
LoD2
"
in
kreis_link
[
"
uri
"
]
and
kreis_link
[
"
level
"
]
==
4
:
kreis_info_json_path
=
TMP_DIR
/
f
"hessen_
{
kreis_link
[
'name'
]
}
.json"
download_file
(
SERVER
+
kreis_link
[
'
uri
'
],
kreis_info_json_path
)
download_file
(
SERVER
+
kreis_link
[
"
uri
"
],
kreis_info_json_path
)
with
open
(
kreis_info_json_path
)
as
json_file
:
kreis_data
=
json
.
load
(
json_file
)
creation_date
=
kreis_data
[
'searchresult'
][
'packages'
][
0
][
'creationDate'
]
zip_link
=
kreis_data
[
'searchresult'
][
'packages'
][
0
][
'downloadLink'
][
'uri'
]
creation_date
=
kreis_data
[
"searchresult"
][
"packages"
][
0
][
"creationDate"
]
# NOTE: Some links may contain spaces
zip_link
=
quote
(
kreis_data
[
"searchresult"
][
"packages"
][
0
][
"downloadLink"
][
"uri"
])
citygmls
.
append
(
CityGMLWithDate
(
url
=
SERVER
+
zip_link
,
bundesland
=
HESSEN
,
source_date
=
datetime
.
strptime
(
creation_date
,
"%d.%m.%Y"
),
)
)
)
download_all_files
(
citygmls
,
jobs
=
1
,
sleep
=
20
)
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