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: Give verbose message about number for all types #2498

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

wenzeslaus
Copy link
Member

@wenzeslaus wenzeslaus commented Jul 26, 2022

When there are no areas in the vector map, v.to.rast gave warning. After #2459, it gives a verbose message about number of selected areas when areas are selected as type. This gives the verbose message for all types when they are selected making the behavior more consistent across types (points, lines, boundaries, and centroids).

The default for type is point, line, and area, so three verbose messages are produced (when verbose output is enabled) for any vector map. (For the original version PR - as an alternative to #2459 with warnings consistent with the behavior before #2459 - a common vector map with a single type (point, line, or area) and the default parameters would 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
vector/v.to.rast/vect2rast.c Outdated Show resolved Hide resolved
vector/v.to.rast/vect2rast.c Outdated Show resolved Hide resolved
vector/v.to.rast/vect2rast.c Outdated Show resolved Hide resolved
vector/v.to.rast/vect2rast.c Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@wenzeslaus wenzeslaus marked this pull request as ready for review December 30, 2024 18:30
@wenzeslaus wenzeslaus changed the title v.to.rast: Always give warning when type is not present v.to.rast: Give verbose message about number for all types Dec 30, 2024
@wenzeslaus
Copy link
Member Author

v.to.rast now give consistent verbose message about number for all features for all types. The PR is ready for review.

@echoix
Copy link
Member

echoix commented Dec 31, 2024

@wenzeslaus I'll let you merge, so you can adapt the commit message, as the first commit was close to the original description of this PR (using warning), but changed just now. It'll make more sense if you do it

@echoix echoix assigned wenzeslaus and unassigned wenzeslaus Jan 15, 2025
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.

3 participants