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
c69d76a9
Commit
c69d76a9
authored
Nov 05, 2025
by
Eric Duminil
Browse files
Extracting Zips
parent
db1b113d
Changes
1
Hide whitespace changes
Inline
Side-by-side
07_hessen.py
View file @
c69d76a9
...
@@ -3,6 +3,7 @@ import json
...
@@ -3,6 +3,7 @@ import json
from
datetime
import
datetime
from
datetime
import
datetime
from
pathlib
import
Path
from
pathlib
import
Path
from
urllib.parse
import
quote
from
urllib.parse
import
quote
import
zipfile
from
citygml_download
import
TMP_DIR
,
Bundesland
,
CityGMLWithDate
,
download_all_files
,
download_file
from
citygml_download
import
TMP_DIR
,
Bundesland
,
CityGMLWithDate
,
download_all_files
,
download_file
...
@@ -24,7 +25,13 @@ class ZipFile(CityGMLWithDate):
...
@@ -24,7 +25,13 @@ class ZipFile(CityGMLWithDate):
def
download
(
self
,
tmp_dir
:
Path
=
TMP_DIR
,
max_retries
:
int
=
3
,
sleep
:
int
=
0
)
->
bool
:
def
download
(
self
,
tmp_dir
:
Path
=
TMP_DIR
,
max_retries
:
int
=
3
,
sleep
:
int
=
0
)
->
bool
:
result
=
super
().
download
(
tmp_dir
,
max_retries
,
sleep
)
result
=
super
().
download
(
tmp_dir
,
max_retries
,
sleep
)
if
result
:
if
result
:
print
(
"TODO: Extract zip"
)
output_folder
=
self
.
download_folder
/
self
.
path
.
stem
with
zipfile
.
ZipFile
(
self
.
path
,
"r"
)
as
main_zip
:
main_zip
.
extractall
(
output_folder
)
for
inner_zip_path
in
output_folder
.
glob
(
'*.zip'
):
with
zipfile
.
ZipFile
(
inner_zip_path
,
"r"
)
as
inner_zip
:
inner_zip
.
extractall
(
self
.
bundesland
.
download_folder
)
print
(
f
" Extracted
{
inner_zip_path
}
"
)
return
result
return
result
...
...
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