Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v.to.rast: Always give warning when type is not present #2498

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wenzeslaus
Copy link
Member

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.

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.
@wenzeslaus
Copy link
Member Author

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.

@wenzeslaus wenzeslaus added this to the 8.4.0 milestone Jul 26, 2022
@wenzeslaus wenzeslaus added vector Related to vector data processing C Related code is in C labels Jul 26, 2022
@wenzeslaus
Copy link
Member Author

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.

@wenzeslaus wenzeslaus marked this pull request as draft August 8, 2022 16:49
@wenzeslaus wenzeslaus modified the milestones: 8.3.0, 8.4.0 Feb 10, 2023
@wenzeslaus wenzeslaus modified the milestones: 8.4.0, 8.5.0 Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C module vector Related to vector data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants