Commit e5074fbc authored by Eric Duminil's avatar Eric Duminil
Browse files

Zip files are for Brandenburg

parent 35569a34
...@@ -2,6 +2,7 @@ import re ...@@ -2,6 +2,7 @@ import re
from datetime import datetime from datetime import datetime
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
from zipfile_download import ZipFile
BRANDENBURG = Bundesland( BRANDENBURG = Bundesland(
"Brandenburg", "Brandenburg",
...@@ -20,18 +21,18 @@ if __name__ == "__main__": ...@@ -20,18 +21,18 @@ if __name__ == "__main__":
if not html_path.exists(): if not html_path.exists():
download_file(BRANDENBURG.source, TMP_DIR / html_path) download_file(BRANDENBURG.source, TMP_DIR / html_path)
citygmls = [] zipfiles = []
with open(html_path) as html: with open(html_path) as html:
for line in html: for line in html:
if m := ZIP_AND_DATE.search(line): if m := ZIP_AND_DATE.search(line):
name, date = m.groups() name, date = m.groups()
citygmls.append( zipfiles.append(
CityGMLWithDate( ZipFile(
url=BRANDENBURG.source + name, url=BRANDENBURG.source + name,
bundesland=BRANDENBURG, bundesland=BRANDENBURG,
source_date=datetime.strptime(date, "%Y-%m-%d %H:%M"), source_date=datetime.strptime(date, "%Y-%m-%d %H:%M"),
) )
) )
download_all_files(citygmls) download_all_files(zipfiles)
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