-
-
Notifications
You must be signed in to change notification settings - Fork 323
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: Use verbose for no area message, not warning #2459
v.to.rast: Use verbose for no area message, not warning #2459
Conversation
If there are areas in the vector map and areas have been requested to be rasterized with the type option, but no areas have been rasterized, I would still like to get a warning. |
This PR is trying to still address whatever was the motivation for the warning by giving a more detailed verbose message. If the user is wondering what is happening, There is a series of issues with the current behavior: 1. False alarmWhen you rasterize points or lines, you get a message Without this PR:
With the PR:
2. Inconsistency between typesThe behavior is not consistent for areas-only map where you get no warning about no lines or points (or whatever else is accepted here for type). The module uses the areas without warnings
3. Inconsistency with other modulesThe warning for no features of a given type is not consistent with other modules which take type and have default which contains multiple types. For example, v.extract has 4. Empty selection is generally a valid resultEven when type option is explicitly set to a single type, v.extract does not give a warning, it is simply an empty selection like anything else. d.vect does not give any warning either for |
When there are no areas in the vector map, v.to.rast would give warning, 'No areas selected'. However, no areas is a perfectly fine state when converting a vector map with points or lines only, so the warning is misleading. To cover the case where a user may need to know about the number of areas, a verbose message is now added reporting the number replacing both the warning and a debug message with the number.
d92d765
to
a2c0647
Compare
Merged. This removes the false alarm, warning inconsistency in behavior between types, and warning inconsistency with other modules. Empty selection is generally a valid result, so here it also gives no warning. The alternative of always giving warning when no features of a specific type are present, generates a lot of warnings (see #2498). Another alternative would be to completely rework of how the type option works, e.g., the default would be empty and warnings would be present if the type was explicit, but that still would be somewhat inconsistent with other modules and does not follow that an empty selection is generally a valid result. |
When there are no areas in the vector map, v.to.rast would give warning, 'No areas selected'. However, no areas is a perfectly fine state when converting a vector map with points or lines only, so the warning is misleading. To cover the case where a user may need to know about the number of areas, a verbose message is now added reporting the number replacing both the warning and a debug message with the number. This removes the false alarm, warning inconsistency in behavior between types, and warning inconsistency with other modules. Empty selection is generally a valid result, so here it also gives no warning. The alternative of always giving warning when no features of a specific type are present, generates a lot of warnings. Another alternative would be to completely rework of how the type option works, e.g., the default would be empty and warnings would be present if the type was explicit, but that still would be somewhat inconsistent with other modules and does not follow that an empty selection is generally a valid result.
When there are no areas in the vector map, v.to.rast would give warning, 'No areas selected'. However, no areas is a perfectly fine state when converting a vector map with points or lines only, so the warning is misleading. To cover the case where a user may need to know about the number of areas, a verbose message is now added reporting the number replacing both the warning and a debug message with the number. This removes the false alarm, warning inconsistency in behavior between types, and warning inconsistency with other modules. Empty selection is generally a valid result, so here it also gives no warning. The alternative of always giving warning when no features of a specific type are present, generates a lot of warnings. Another alternative would be to completely rework of how the type option works, e.g., the default would be empty and warnings would be present if the type was explicit, but that still would be somewhat inconsistent with other modules and does not follow that an empty selection is generally a valid result.
When there are no areas in the vector map, v.to.rast would give warning, 'No areas selected'. However, no areas is a perfectly fine state when converting a vector map with points or lines only, so the warning is misleading. To cover the case where a user may need to know about the number of areas, a verbose message is now added reporting the number replacing both the warning and a debug message with the number. This removes the false alarm, warning inconsistency in behavior between types, and warning inconsistency with other modules. Empty selection is generally a valid result, so here it also gives no warning. The alternative of always giving warning when no features of a specific type are present, generates a lot of warnings. Another alternative would be to completely rework of how the type option works, e.g., the default would be empty and warnings would be present if the type was explicit, but that still would be somewhat inconsistent with other modules and does not follow that an empty selection is generally a valid result.
When there are no areas in the vector map, v.to.rast would give warning, 'No areas selected'. However, no areas is a perfectly fine state when converting a vector map with points or lines only, so the warning is misleading.
To cover the case where a user may need to know about the number of areas, a verbose message is now added reporting the number replacing both the warning and a debug message with the number.