Opened 6 years ago
Last modified 6 years ago
#3598 new enhancement
v.rast.stats: limit region extent to that of vector
Reported by: | mlennert | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.6.2 |
Component: | Vector | Version: | unspecified |
Keywords: | v.rast.stats region | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Currently, v.rast.stats follows general GRASS GIS procedure and respects the current computational region. This means that it rasterizes the vector map and creates a raster map of the size of that region. If the vector map only covers a very small portion of the current region, this means a lot of wasted computing resources and time.
v.rast.stats already slightly changes the current region by aligning it to the raster. By also limiting the extent to the vector (see attached patch), computational time can potentially be significantly reduced.
Two questions before I apply:
- As the expected behavior of v.rast.stats is to get stats for the features in the vector map, limiting the region extent to that of the vector does not change anything in the results and rather is in line with expected behavior. Any objection ?
- Is there a risk that by using the vector extent, but aligning to the raster, we lose some edge parts of the vector features ? Or does aligning always extend the region to beyond the request extent ?
Attachments (1)
Change History (6)
by , 6 years ago
Attachment: | v_rast_stats_vectorregion.diff added |
---|
follow-up: 2 comment:1 by , 6 years ago
comment:2 by , 6 years ago
Replying to SBL:
See also: https://trac.osgeo.org/grass/ticket/3523#comment:4
Personally, I would prefer if v.rast.stats would not change the computational region at all (like majority of the other modules).
So that means you prefer option 1 in ticket:3523#comment:4. But you also provide option 3 which uses the vector extent.
If we just tell people in the man page that they have to take that responsibility, this kind of defeats the purpose of your proposals in #3523 in the case they would like to calculate statistics on a series of rasters which are not aligned with each other.
I also have not made experiments to see how much of a difference the change of alignment actually makes.
Intuitively, I would go for your option 3.
comment:3 by , 6 years ago
Replying to mlennert:
- Is there a risk that by using the vector extent, but aligning to the raster, we lose some edge parts of the vector features ? Or does aligning always extend the region to beyond the request extent ?
No, aligning to raster map either leaves the extents untouched, or grows the region.
v.rast.stats could use a temporary region to get statistics. In this particular case I think it is ok if the current region is not used.
See also: https://trac.osgeo.org/grass/ticket/3523#comment:4
Personally, I would prefer if v.rast.stats would not change the computational region at all (like majority of the other modules).