Bladeren bron

patch from Martin Landa to catch wrong atype parameter (user error)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@45347 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 14 jaren geleden
bovenliggende
commit
eb03421af3
1 gewijzigde bestanden met toevoegingen van 10 en 2 verwijderingen
  1. 10 2
      vector/v.overlay/main.c

+ 10 - 2
vector/v.overlay/main.c

@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
 
     /* 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 @@ int main(int argc, char *argv[])
 
 	nlines = Vect_get_num_lines(&(In[input]));
 
+	nlines_out = 0;
 	for (line = 1; line <= nlines; line++) {
 	    int ltype;
 
@@ -224,8 +225,15 @@ int main(int argc, char *argv[])
 	    }
 
 	    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 */