[GRASS-SVN] r66781 - grass/trunk/vector/v.what.rast
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Nov 11 07:35:10 PST 2015
Author: martinl
Date: 2015-11-11 07:35:10 -0800 (Wed, 11 Nov 2015)
New Revision: 66781
Modified:
grass/trunk/vector/v.what.rast/main.c
Log:
v.what.rast: exit when no features of given type found
Modified: grass/trunk/vector/v.what.rast/main.c
===================================================================
--- grass/trunk/vector/v.what.rast/main.c 2015-11-11 15:15:48 UTC (rev 66780)
+++ grass/trunk/vector/v.what.rast/main.c 2015-11-11 15:35:10 UTC (rev 66781)
@@ -241,6 +241,11 @@
}
Vect_close(&Map);
+ if (point_cnt < 1) {
+ G_important_message(_("No features of type (%s) found in vector map <%s>"),
+ opt.type->answer, opt.vect->answer);
+ exit(EXIT_SUCCESS);
+ }
G_debug(1, "Read %d vector points", point_cnt);
/* Cache may contain duplicate categories, sort by cat, find and remove duplicates
* and recalc count and decrease point_cnt */
@@ -646,7 +651,8 @@
/* Report */
G_verbose_message(_("%d categories loaded from vector"), point_cnt);
if (dupl_cnt > 0)
- G_message(_("%d duplicate categories in vector"), dupl_cnt);
+ G_message(_("%d duplicate categories in vector map <%s>"),
+ dupl_cnt, opt.vect->answer);
if (!print_flag->answer) {
G_verbose_message(_("%d categories loaded from table"), select);
More information about the grass-commit
mailing list