Skip to content

Commit

Permalink
v.rast.stats: Mask is simply used, not touched (#5002)
Browse files Browse the repository at this point in the history
Since 9b03a3c, v.rast.stats is using r.univar zones instead of looping through categories with individual masked r.univar calls. The note about restoring raster mask does not apply since the mask is not touched. It is just used in the background as with any other tool.

The raster grid alignment is modified by a g.region call with align, so that still applies, but the temporary part is not true anymore. It is purely internal instead.
  • Loading branch information
wenzeslaus authored Jan 29, 2025
1 parent e135cab commit 5626d0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/v.rast.stats/v.rast.stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ <h2>NOTES</h2>
DBF specification to 10 characters. Therefore it is advised to be economical
in the use of the column prefix when using DBF as any additional characters
will be chopped off.
<p>If a MASK is present, it will be restored after the script finished.
The script changes temporarily to the resolution of the given raster map.
<p>The script internally aligns the raster grid cells to the grid of the first
input raster map.
<p>If an area has several categories in the selected layer (equivalent
to overlapping polygons in Simple Features), only one category will be
kept during the rasterization process. Statistics for the skipped
Expand Down
4 changes: 2 additions & 2 deletions scripts/v.rast.stats/v.rast.stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ def main():
# save current settings:
gs.use_temp_region()

# Temporarily aligning region resolution to $RASTER resolution
# keep boundary settings
# Align region cells with the first input raster,
# keeping the (approximate) extent settings.
gs.run_command("g.region", align=rasters[0])

# check if DBF driver used, in this case cut to 10 chars col names:
Expand Down

0 comments on commit 5626d0f

Please sign in to comment.