Opened 6 years ago

#3848 new enhancement

Unexpected error with v.what.rast and v.rast.stats

Reported by: micha Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Default Version: unspecified
Keywords: Cc:
CPU: Unspecified Platform: All

Description

In general vector modules do not check or honor region settings. (The exception is v.to.rast, and this is specifically mentioned in the manual). However both v.rast.stats and v.what.rast require that the computational region covers the vector being queried.

When running either of these modules with region settings that do not cover the vector, the error messages are unhelpful, even misleading:

micha@TP480:~$ v.what.rast weir7 rast=dem_4m col=dem type=centroid
Reading features from vector map...
No features of type (centroid) found in vector map <weir7>

micha@TP480:~$ v.rast.stats weir7 rast=dem_4m column_pref=dem
ERROR: No categories found in raster map

I suggest to add text to the man page of both, similar to the explanation in v.to.rast:

v.to.rast will only affect data in areas lying inside the boundaries of the current geographic region. A grid cell belongs to the area where the grid cell center falls into.

Before running v.to.rast, the user should therefore ensure that the current geographic region is correctly set and that the region resolution is at the desired level.

In addition, it would be helpful to modify the code of both modules to check region settings and output a relevant error message if the vector is outside the current region.

Change History (0)

Note: See TracTickets for help on using tickets.