[GRASS-SVN] r62736 - grass/trunk/vector/v.generalize

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 14 07:10:31 PST 2014


Author: neteler
Date: 2014-11-14 07:10:31 -0800 (Fri, 14 Nov 2014)
New Revision: 62736

Modified:
   grass/trunk/vector/v.generalize/main.c
Log:
v.generalize: check that input map contains lines

Modified: grass/trunk/vector/v.generalize/main.c
===================================================================
--- grass/trunk/vector/v.generalize/main.c	2014-11-14 11:47:49 UTC (rev 62735)
+++ grass/trunk/vector/v.generalize/main.c	2014-11-14 15:10:31 UTC (rev 62736)
@@ -322,6 +322,11 @@
     if (Vect_open_old2(&In, map_in->answer, "", field_opt->answer) < 1)
 	G_fatal_error(_("Unable to open vector map <%s>"), map_in->answer);
 
+    if (Vect_get_num_primitives(&In, mask_type) == 0) {
+	G_warning(_("No lines found in input map <%s>"), map_in->answer);
+	Vect_close(&In);
+	exit(EXIT_SUCCESS);
+    }
     with_z = Vect_is_3d(&In);
 
     if (0 > Vect_open_new(&Out, map_out->answer, with_z)) {



More information about the grass-commit mailing list