OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
854 stars 311 forks source link

[Feat] r.univar/t.rast.univar: allow r-flag also with zones input #4576

Closed ninsbl closed 3 weeks ago

ninsbl commented 1 month ago

Is your feature request related to a problem? Please describe. When computing univariate statistics for zones (e.g. a bunch of administrative units) over a remote sensing product, that covers only parts of my general area of interest (i.e. the administrative units in question), processing takes unneccessary time because in r.univar the zones option and the r-flag are mutually exclusive.

That limitation is handed down to t.rast.univar.

Describe the solution you'd like Idealy, it should be possible to combine the r-flag and the zones option in r.univar and t.rast.univar for use cases as above.

Describe alternatives you've considered The named limitation can be worked around by not using the r-flag and defining the computational region accordingly instead (e.g. g.region -p raster=input_map align=zones_map), before r.univar is run

In t.rast.univar that can be even facilitated using a or using a compute environment.

Additional context The limitation is particularly painful when processing many maps in a time series, while setting the region for a single r.univar call should be OK. So the suggested work-around for t.rast.univar may thus be sufficient to fix this issue.