I have DEMs covering a large area and want to limit analyses to a single
drainage basin. I can use 'g.region vect=basin_name' or 'r.mask
vect=basin_name' and want to learn of differences by applying one in
preference to tha other. Are there situations where one is preferred over
the other? Does computational time differ between the two?
TIA,
Rich
Hello Rich,
g.region creates a rectangular computational region while r.mask can create an irregular mask. If you use r.mask, any cells outside the mask will be ignored, so you have to make sure that your mask is big enough to cover your basin. In terms of computational time, r.mask can be faster depending on what modules you need. For example, when you run flow accumulation, you may save some time using r.mask because you don’t have to calculate flow accumulation outside your area of interest. If you use g.region that covers your basin, you calculate flow accumulation outside the basin within the rectangular region. So in general, I would say r.mask is preferred if and only if the mask is correct.
Regards,
Huidae
···
On Tue, Jul 10, 2018 at 1:01 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:
I have DEMs covering a large area and want to limit analyses to a single
drainage basin. I can use ‘g.region vect=basin_name’ or ‘r.mask
vect=basin_name’ and want to learn of differences by applying one in
preference to tha other. Are there situations where one is preferred over
the other? Does computational time differ between the two?
TIA,
Rich
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
–
Huidae Cho, Ph.D., PE, M.ASCE, CFM, GISP
Senior Geospatial Engineer, MapAnything
Open Source GIS Developer, GRASS GIS Development Team
On Tue, 10 Jul 2018, Huidae Cho wrote:
g.region creates a rectangular computational region while r.mask can
create an irregular mask. If you use r.mask, any cells outside the mask
will be ignored, so you have to make sure that your mask is big enough to
cover your basin. In terms of computational time, r.mask can be faster
depending on what modules you need. For example, when you run flow
accumulation, you may save some time using r.mask because you don't have
to calculate flow accumulation outside your area of interest. If you use
g.region that covers your basin, you calculate flow accumulation outside
the basin within the rectangular region. So in general, I would say r.mask
is preferred if and only if the mask is correct.
Huidae,
This is a perfect answer as it covers all the important differences
between the two. Thanks very much for the lesson.
Regards,
Rich
On 11/07/18 05:46, Huidae Cho wrote:
Hello Rich,
g.region creates a rectangular computational region while r.mask can create an irregular mask. If you use r.mask, any cells outside the mask will be ignored, so you have to make sure that your mask is big enough to cover your basin. In terms of computational time, r.mask can be faster depending on what modules you need. For example, when you run flow accumulation, you may save some time using r.mask because you don't have to calculate flow accumulation outside your area of interest. If you use g.region that covers your basin, you calculate flow accumulation outside the basin within the rectangular region. So in general, I would say r.mask is preferred if and only if the mask is correct.
See also the general raster info: https://grass.osgeo.org/grass74/manuals/rasterintro.html which explains that:
1. Raster output maps have their bounds and resolution equal to those of the current computational region.
2. Raster input maps are automatically cropped/padded and rescaled (using nearest-neighbour resampling) to match the current region.
3. Raster input maps are automatically masked if a raster map named MASK exists. The MASK is only applied when reading maps from the disk.
In other words: the MASK only applies for reading. For a given region and MASK, interpolation will happen for the entire region, but only using raster input data which falls within the MASK (vector input data is read from the entire region generally). If you erase the MASK, you will see that the result of interpolation (and other raster commands) covers the entire region.
Moritz
On Wed, 11 Jul 2018, Moritz Lennert wrote:
See also the general raster info: https://grass.osgeo.org/grass74/manuals/rasterintro.html which explains that:
1. Raster output maps have their bounds and resolution equal to those of the current computational region.
2. Raster input maps are automatically cropped/padded and rescaled (using nearest-neighbour resampling) to match the current region.
3. Raster input maps are automatically masked if a raster map named MASK exists. The MASK is only applied when reading maps from the disk.
In other words: the MASK only applies for reading. For a given region and MASK, interpolation will happen for the entire region, but only using raster input data which falls within the MASK (vector input data is read from the entire region generally). If you erase the MASK, you will see that the result of interpolation (and other raster commands) covers the entire region.
Moritz,
Thank you.
Regards,
Rich