[GRASS-SVN] r45347 - grass/trunk/vector/v.overlay

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 9 09:43:22 EST 2011


Author: neteler
Date: 2011-02-09 06:43:21 -0800 (Wed, 09 Feb 2011)
New Revision: 45347

Modified:
   grass/trunk/vector/v.overlay/main.c
Log:
patch from Martin Landa to catch wrong atype parameter (user error)

Modified: grass/trunk/vector/v.overlay/main.c
===================================================================
--- grass/trunk/vector/v.overlay/main.c	2011-02-09 14:43:06 UTC (rev 45346)
+++ grass/trunk/vector/v.overlay/main.c	2011-02-09 14:43:21 UTC (rev 45347)
@@ -196,7 +196,7 @@
 
     /* Copy lines to output */
     for (input = 0; input < 2; input++) {
-	int ncats, index;
+	int ncats, index, nlines_out;
 
 	Vect_set_open_level(2);
 	Vect_open_old2(&(In[input]), in_opt[input]->answer, "", field_opt[input]->answer);
@@ -207,6 +207,7 @@
 
 	nlines = Vect_get_num_lines(&(In[input]));
 
+	nlines_out = 0;
 	for (line = 1; line <= nlines; line++) {
 	    int ltype;
 
@@ -224,8 +225,15 @@
 	    }
 
 	    Vect_write_line(&Out, ltype, Points, Cats);
+	    nlines_out++;
 	}
-
+	if (nlines_out == 0) {
+	    Vect_delete(out_opt->answer);
+	    G_fatal_error(_("No %s features found in vector map <%s>. Verify '%s' parameter."),
+		      type_opt[input]->answer, Vect_get_full_name(&(In[input])),
+		      type_opt[input]->key);
+	}
+	
 	/* Allocate attributes */
 	attr[input].n = 0;
 	/* this may be more than necessary */



More information about the grass-commit mailing list