[GRASS-SVN] r66885 - grass/branches/releasebranch_7_0/vector/v.what.rast

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 21 10:30:56 PST 2015


Author: martinl
Date: 2015-11-21 10:30:56 -0800 (Sat, 21 Nov 2015)
New Revision: 66885

Modified:
   grass/branches/releasebranch_7_0/vector/v.what.rast/main.c
Log:
v.what.rast: exit when no features of given type found
             (merge r66781 from trunk)


Modified: grass/branches/releasebranch_7_0/vector/v.what.rast/main.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.what.rast/main.c	2015-11-21 17:59:42 UTC (rev 66884)
+++ grass/branches/releasebranch_7_0/vector/v.what.rast/main.c	2015-11-21 18:30:56 UTC (rev 66885)
@@ -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