Skip to content

Commit

Permalink
Switch from warn when enabled and none to verbose report number when …
Browse files Browse the repository at this point in the history
…enabled
  • Loading branch information
wenzeslaus committed Dec 30, 2024
1 parent 0f560b0 commit ddc4bb8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion vector/v.to.rast/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* OGR support by Martin Landa <landa.martin gmail.com>
* Markus Metz (labelcol, cats, where options)
* PURPOSE: Converts vector map to raster map
* COPYRIGHT: (C) 2003-2018 by the GRASS Development Team
* COPYRIGHT: (C) 2003-2024 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
Expand Down
24 changes: 16 additions & 8 deletions vector/v.to.rast/vect2rast.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,25 @@ int vect_to_rast(const char *vector_map, const char *raster_map,
dense = 0;
}

if (ftype & GV_POINT && !Vect_get_num_primitives(&Map, GV_POINT)) {
G_warning(_("No points selected from vector map <%s>"), vector_map);
if (ftype & GV_POINT) {
G_verbose_message(
_("Number of points selected from vector map <%s>: %d"), vector_map,
Vect_get_num_primitives(&Map, GV_POINT));
}
if (ftype & GV_LINE && !Vect_get_num_primitives(&Map, GV_LINE)) {
G_warning(_("No lines selected from vector map <%s>"), vector_map);
if (ftype & GV_LINE) {
G_verbose_message(
_("Number of lines selected from vector map <%s>: %d"), vector_map,
Vect_get_num_primitives(&Map, GV_LINE));
}
if (ftype & GV_BOUNDARY && !Vect_get_num_primitives(&Map, GV_BOUNDARY)) {
G_warning(_("No boundaries selected from vector map <%s>"), vector_map);
if (ftype & GV_BOUNDARY) {
G_verbose_message(
_("Number of boundaries selected from vector map <%s>: %d"),
vector_map, Vect_get_num_primitives(&Map, GV_BOUNDARY));
}
if (ftype & GV_CENTROID && !Vect_get_num_primitives(&Map, GV_CENTROID)) {
G_warning(_("No centroids selected from vector map <%s>"), vector_map);
if (ftype & GV_CENTROID) {
G_verbose_message(
_("Number of centroids selected from vector map <%s>: %d"),
vector_map, Vect_get_num_primitives(&Map, GV_CENTROID));
}

nlines = Vect_get_num_primitives(&Map, ftype);
Expand Down

0 comments on commit ddc4bb8

Please sign in to comment.