Skip to content

Commit

Permalink
add support for Sachsen
Browse files Browse the repository at this point in the history
  • Loading branch information
juleshaas committed Jan 16, 2024
1 parent 69cd54b commit c63b0de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions download_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Rheinland-Pfalz": None,
"Schleswig-Holstein": None,
"Saarland": None,
"Sachsen": None,
"Sachsen": "https://geocloud.landesvermessung.sachsen.de/index.php/s"
"/YgBfai4gXoiExJx/download?path=%2F&files=hu_sn_shape.zip",
"Sachsen-Anhalt": None,
"Thüringen": "https://geoportal.geoportal-th.de/hausko_umr/HU-TH.zip",
}
Expand All @@ -36,7 +37,7 @@
"Rheinland-Pfalz": None,
"Schleswig-Holstein": None,
"Saarland": None,
"Sachsen": None,
"Sachsen": "hu_sn_gebaeude_20231123.shp",
"Sachsen-Anhalt": None,
"Thüringen": "gebaeude-th.shp",
}
Expand Down
1 change: 1 addition & 0 deletions v.alkis.buildings.import.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ <h2>DESCRIPTION</h2>
<li>Brandenburg</li>
<li>Hessen</li>
<li>Nordrhein-Westfalen</li>
<li>Sachsen</li>
</ul>

<h2>REQUIREMENTS</h2>
Expand Down
13 changes: 7 additions & 6 deletions v.alkis.buildings.import.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
############################################################################
#
# MODULE: v.alkis.buildings.import
# AUTHOR(S): Lina Krisztian, Anika Weinmann
# AUTHOR(S): Lina Krisztian, Anika Weinmann, Julia Haas

# PURPOSE: Downloads ALKIS building data and imports them into GRASS
# (currently for Berlin, Hessen, NRW)
# (currently for Berlin, Brandenburg, Hessen, NRW, Sachsen)
# COPYRIGHT: (C) 2022-2023 by mundialis GmbH & Co. KG and the GRASS
# Development Team
#
Expand All @@ -23,7 +23,7 @@
#############################################################################

# %Module
# % description: Downloads and imports ALKIS building data (currently for Berlin, Hessen, NRW) into GRASS DB
# % description: Downloads and imports ALKIS building data (currently for Berlin, Brandenburg, Hessen, NRW, Sachsen) into GRASS DB
# % keyword: vector
# % keyword: import
# % keyword: ALKIS
Expand Down Expand Up @@ -520,6 +520,7 @@ def main():
"Berlin",
"Hessen",
"Thüringen",
"Sachsen"
]:
url = URLS[federal_state]
f_state = federal_state
Expand All @@ -545,7 +546,7 @@ def main():
" in 'federal_states'-option given"
)
)
# so far, just Berlin, Brandenburg, Hessen and NRW are implemented;
# so far, just Berlin, Brandenburg, Hessen, NRW and Sachsen are implemented;
# in case single federal state given, and not NRW:
# skips following part
# + grass.message: see above
Expand All @@ -571,7 +572,7 @@ def main():
grass.message(_("Downloading ALKIS building data..."))
if federal_state == "Hessen":
# insert current date into download URL
# try dates of yesterday and tomorrow if its not working
# try dates of yesterday and tomorrow if it's not working
today = datetime.now().strftime("%Y%m%d")
yesterday = (datetime.now() - timedelta(days=1)).strftime(
"%Y%m%d"
Expand Down Expand Up @@ -599,7 +600,7 @@ def main():
)
)
# unzip boundaries
if federal_state in ["Nordrhein-Westfalen", "Hessen", "Thüringen"]:
if federal_state in ["Nordrhein-Westfalen", "Hessen", "Thüringen", "Sachsen"]:
zip_file = zipfile.ZipFile(BytesIO(response.content))
zip_file.extractall(DLDIR)
elif federal_state == "Berlin":
Expand Down

0 comments on commit c63b0de

Please sign in to comment.