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
fddcc0d1
Commit
fddcc0d1
authored
Oct 30, 2025
by
Eric Duminil
Browse files
No warning anymore
parent
bf1f67cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
02_bayern.py
View file @
fddcc0d1
...
...
@@ -39,18 +39,25 @@ def parse_metalink(metalink_path: Path, download_dir: Path) -> list[CityGMLWithH
files
=
[]
for
file_elem
in
root
.
findall
(
"ml:file"
,
ns
):
filename
=
file_elem
.
get
(
"name"
)
if
filename
is
None
:
raise
ValueError
(
f
"Not enough information from
{
file_elem
}
"
)
hash_node
=
file_elem
.
find
(
'ml:hash[@type="sha-256"]'
,
ns
)
if
hash_node
is
None
:
if
hash_node
is
None
or
hash_node
.
text
is
None
:
raise
ValueError
(
f
"
{
filename
}
has no sha256"
)
urls
=
[
url
.
text
for
url
in
file_elem
.
findall
(
"ml:url"
,
ns
)]
# Randomize URL order to distribute load across servers
random
.
shuffle
(
urls
)
urls
=
[
url
.
text
for
url
in
file_elem
.
findall
(
"ml:url"
,
ns
)
if
url
.
text
]
if
len
(
urls
)
==
0
:
raise
ValueError
(
f
"No URL for
{
file_elem
}
"
)
else
:
# Randomize URL order to distribute load across servers
random
.
shuffle
(
urls
)
url
=
urls
[
0
]
files
.
append
(
CityGMLWithHash
(
url
=
url
s
[
0
]
,
url
=
url
,
path
=
download_dir
/
filename
,
coordinate_reference_system
=
"EPSG:25832"
,
source
=
"https://geodaten.bayern.de"
,
...
...
@@ -63,7 +70,7 @@ def parse_metalink(metalink_path: Path, download_dir: Path) -> list[CityGMLWithH
if
__name__
==
"__main__"
:
#
Download and parse metalink
#
Should be from CityGML
download_dir
=
SCRIPT_DIR
/
"citygml"
/
"bayern"
download_dir
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
...
...
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