Skip to content

Commit

Permalink
dgm import as tif (#84)
Browse files Browse the repository at this point in the history
* dgm import as tif

* integrate suggested changes

* delete unnec duplication r.dtm.import.nw

* include r.dem.import in Dockerfile

* .html correct

* Apply suggestions from code review

---------

Co-authored-by: Anika Weinmann <37300249+anikaweinmann@users.noreply.github.com>
  • Loading branch information
vbrunn and anikaweinmann authored Nov 13, 2024
1 parent ca83576 commit 5eeab06
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ RUN grass --tmp-location EPSG:4326 --exec g.extension r.import.ndsm_nrw url=/src
RUN grass --tmp-location EPSG:4326 --exec g.extension m.import.rvr url=/src/grass-gis-addons/m.import.rvr -s
RUN grass --tmp-location EPSG:4326 --exec g.extension m.analyse.trees url=/src/grass-gis-addons/m.analyse.trees -s
RUN grass --tmp-location EPSG:4326 --exec g.extension m.analyse.buildings url=/src/grass-gis-addons/m.analyse.buildings -s
RUN grass --tmp-location EPSG:4326 --exec g.extension r.dem.import url=https://github.com/mundialis/r.dem.import -s
9 changes: 6 additions & 3 deletions grass-gis-addons/m.import.rvr/m.import.rvr.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ <h2>REQUIREMENTS</h2>
g.extension r.import.dtm_nrw url=/path/to/grass-gis-addons/r.import.dtm_nrw
g.extension r.import.ndsm_nrw url=/path/to/grass-gis-addons/r.import.ndsm_nrw
g.extension r.in.pdal.worker url=/path/to/grass-gis-addons/r.in.pdal.worker
g.extension r.dem.import url=https://github.com/mundialis/r.dem.import
</pre></div>


Expand Down Expand Up @@ -109,10 +110,12 @@ <h2>SEE ALSO</h2>
<a href="https://grass.osgeo.org/grass-stable/manuals/r.in.pdal.html">r.in.pdal</a>,
<a href="v.alkis.buildings.import.html">v.alkis.buildings.import</a>,
<a href="r.import.ndsm_nrw.html">r.import.ndsm_nrw</a>,
<a href="r.import.dtm_nrw.html">r.import.dtm_nrw</a>
<a href="r.import.dtm_nrw.html">r.import.dtm_nrw</a>,
<a href="r.dem.import.html">r.dem.import</a>
</em>

<h2>AUTHORS</h2>

Anika Weinmann, <a href="https://www.mundialis.de/">mundialis GmbH &amp; Co. KG</a>
Momen Mawad, <a href="https://www.mundialis.de/">mundialis GmbH &amp; Co. KG</a>
Anika Weinmann, <a href="https://www.mundialis.de/">mundialis GmbH &amp; Co. KG</a><br>
Momen Mawad, <a href="https://www.mundialis.de/">mundialis GmbH &amp; Co. KG</a><br>
Victoria-Leandra Brunn, <a href="https://www.mundialis.de/">mundialis GmbH &amp; Co. KG</a>
16 changes: 12 additions & 4 deletions grass-gis-addons/m.import.rvr/m.import.rvr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# MODULE: m.import.rvr
#
# AUTHOR(S): Anika Weinmann and Momen Mawad
# AUTHOR(S): Anika Weinmann, Momen Mawad and Victoria-Leandra Brunn
#
# PURPOSE: Imports data for the processing of buildings analysis,
# green roofs detection and/or trees analysis
Expand Down Expand Up @@ -1546,12 +1546,20 @@ def compute_data(compute_type, output_name, resolutions=[0.1]):
)
elif compute_type == "ndsm":
for res in resolutions:
dtm = f"dtm_{get_res_str(res)}"
kwargs = {
"dsm": f"dsm_{get_res_str(res)}",
"output_name": output_name,
"dtm": dtm,
}
if options["dtm_file"]:
kwargs["dtm"] = f"dtm_{get_res_str(res)}"
# download DTM
if not options["dtm_file"]:
grass.run_command(
"r.dtm.import.nw",
aoi="study_area",
output=dtm,
flags="r",
)
compute_ndsm(**kwargs)
else:
grass.warning(_(f"Computation of <{compute_type}> not yet supported."))
Expand All @@ -1577,7 +1585,7 @@ def main():

# check if needed addons are installed
check_addon("r.import.ndsm_nrw", "/path/to/r.import.ndsm_nrw")
check_addon("r.import.dtm_nrw", "/path/to/r.import.dtm_nrw")
check_addon("r.dem.import", "https://github.com/mundialis/r.dem.import")

# check if needed paths to data are set
grass.message(_("Checking input parameters ..."))
Expand Down
2 changes: 1 addition & 1 deletion grass-gis-addons/r.import.dtm_nrw/r.import.dtm_nrw.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# into the current mapset.
#
#
# COPYRIGHT: (C) 2021-2023 by mundialis and the GRASS Development Team
# COPYRIGHT: (C) 2021-2023 by mundialis GmbH & Co. KG and the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (>=v2). Read the file COPYING that comes with GRASS
Expand Down

0 comments on commit 5eeab06

Please sign in to comment.