[GRASS-SVN] r70633 - grass/trunk/vector/v.to.db

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 19 17:15:14 PST 2017


Author: hcho
Date: 2017-02-19 17:15:14 -0800 (Sun, 19 Feb 2017)
New Revision: 70633

Modified:
   grass/trunk/vector/v.to.db/main.c
Log:
v.to.db: Don't throw a fatal error when there are no features

Modified: grass/trunk/vector/v.to.db/main.c
===================================================================
--- grass/trunk/vector/v.to.db/main.c	2017-02-20 00:15:14 UTC (rev 70632)
+++ grass/trunk/vector/v.to.db/main.c	2017-02-20 01:15:14 UTC (rev 70633)
@@ -71,7 +71,7 @@
     /* (+ 1 is for cat -1 (no category) reported at the end ) */
     findex = Vect_cidx_get_field_index(&Map, options.field);
     if (findex > -1) {
-	n = Vect_cidx_get_num_unique_cats_by_index(&Map, findex);
+	n = Vect_cidx_get_num_cats_by_index(&Map, findex);
     }
     else {
 	n = 0;
@@ -80,7 +80,6 @@
     Values = (struct value *) G_calloc(n + 1, sizeof(struct value));
 
     /* prepopulate Values */
-    n = Vect_cidx_get_num_cats_by_index(&Map, findex);
     i = 0;
     Values[i].cat = -1;		/* features without category */
     Values[i].used = 0;



More information about the grass-commit mailing list