[GRASS-SVN] r45345 - grass/branches/releasebranch_6_4/vector/v.overlay

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 9 09:42:51 EST 2011


Author: neteler
Date: 2011-02-09 06:42:51 -0800 (Wed, 09 Feb 2011)
New Revision: 45345

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

Modified: grass/branches/releasebranch_6_4/vector/v.overlay/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.overlay/main.c	2011-02-09 12:42:22 UTC (rev 45344)
+++ grass/branches/releasebranch_6_4/vector/v.overlay/main.c	2011-02-09 14:42:51 UTC (rev 45345)
@@ -194,7 +194,7 @@
 
     /* Copy lines to output */
     for (input = 0; input < 2; input++) {
-	int ncats, index;
+	int ncats, index, nlines_out;
 
 	G_message(_("Copying vector objects from vector map <%s>..."),
 		  in_opt[input]->answer);
@@ -210,6 +210,7 @@
 
 	nlines = Vect_get_num_lines(&(In[input]));
 
+	nlines_out = 0;
 	for (line = 1; line <= nlines; line++) {
 	    int ltype;
 
@@ -227,8 +228,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