Skip to content

Commit

Permalink
r.basin: g.region using raster to set the correct resolution (#568)
Browse files Browse the repository at this point in the history
* r.basin: g.region using raster to set the correct resolution

* Use the complete parameter name raster=
  • Loading branch information
HuidaeCho committed Jun 28, 2021
1 parent 4d72dba commit d2e153c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions grass7/raster/r.basin/r.basin.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,7 @@ def main():
# Rectangle containing basin
basin_east = baricenter_slope_baricenter[33]
basin_north = baricenter_slope_baricenter[34]
info_region_basin = grass.read_command(
"g.region", vect=options["prefix"] + "_" + mapname[0] + "_basin", flags="m"
)
info_region_basin = grass.read_command("g.region", raster=r_basin, flags="m")

grass.message("g.region done")
dict_region_basin = dict(
Expand Down Expand Up @@ -646,9 +644,10 @@ def main():
"r.info", flags="r", map="r_elevation_crop"
)
minmax_height_basin = minmax_height_basin.strip().split("\n")
min_height_basin, max_height_basin = float(
minmax_height_basin[0].split("=")[-1]
), float(minmax_height_basin[1].split("=")[-1])
min_height_basin, max_height_basin = (
float(minmax_height_basin[0].split("=")[-1]),
float(minmax_height_basin[1].split("=")[-1]),
)
H1 = max_height_basin
H2 = min_height_basin
HM = H1 - H2
Expand Down

0 comments on commit d2e153c

Please sign in to comment.