grass
grass copied to clipboard
v.to.rast: Always give warning when type is not present
When there are no areas in the vector map, v.to.rast gives warning, 'No areas selected'. This makes the behavior consistent for all types, so same warning is generated for points, lines, boundaries, and centroids.
The default for type is point, line, and area, so for a common vector map with a single type (point, line, or area), the default parameters now produce two warnings.
This PR addresses point 2 from #2459 by adding warnings for other types instead of removing the one for areas as #2459 does.
The types with this PR behave consistently resulting always in two warnings in the example cases.
Examples before
Points without this PR result in one warning:
$ v.to.rast input=bridges@PERMANENT output=bridges use=val
WARNING: No areas selected from vector map <bridges@PERMANENT>
Reading features...
...
v.to.rast complete.
Areas without this PR result in no warning:
$ v.to.rast input=nc_state@PERMANENT output=boundary use=val
Reading areas...
...
v.to.rast complete.
Examples after
Points with this PR result in two warnings:
$ v.to.rast input=bridges@PERMANENT output=bridges use=val
WARNING: No areas selected from vector map <bridges@PERMANENT>
WARNING: No lines selected from vector map <bridges@PERMANENT>
Reading features...
...
v.to.rast complete.
Areas with this PR result in two warnings:
$ v.to.rast input=nc_state@PERMANENT output=boundary use=val
WARNING: No points selected from vector map <nc_state@PERMANENT>
WARNING: No lines selected from vector map <nc_state@PERMANENT>
Reading areas...
...
v.to.rast complete.
This is still somewhat valid even after #2459 was merged because the warnings can be turned into verbose messages and than it would be very consistent across types even with verbose.