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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 16 08:33:41 EST 2008


Author: martinl
Date: 2008-12-16 08:33:40 -0500 (Tue, 16 Dec 2008)
New Revision: 34907

Modified:
   grass/trunk/vector/v.to.db/update.c
Log:
v.to.db: fix qlayer
	 (merge from devbr6, r34906)


Modified: grass/trunk/vector/v.to.db/update.c
===================================================================
--- grass/trunk/vector/v.to.db/update.c	2008-12-16 13:30:29 UTC (rev 34906)
+++ grass/trunk/vector/v.to.db/update.c	2008-12-16 13:33:40 UTC (rev 34907)
@@ -42,10 +42,10 @@
 
     db_begin_transaction(driver);
 
-    /* select existing categories to array (array is sorted) */
-    vstat.select = db_select_int(driver, qFi->table, qFi->key, NULL, &catexst);
+    /* select existing categories (layer) to array (array is sorted) */
+    vstat.select = db_select_int(driver, Fi->table, Fi->key, NULL, &catexst);
     G_debug(3, "Existing categories: %d", vstat.select);
-
+    
     /* create beginning of stmt */
     switch (options.option) {
     case O_CAT:
@@ -73,7 +73,9 @@
     /* update */
     G_message(_("Updating database..."));
     for (i = 0; i < vstat.rcat; i++) {
-	fcat = Values[i].cat;
+	G_percent(i, vstat.rcat, 2);
+
+	fcat = Values[i].cat;	
 	if (fcat < 0)
 	    continue;
 	switch (options.option) {
@@ -184,8 +186,8 @@
 		    break;
 		}
 	    }
-	    G_percent(i + 1, vstat.rcat, 2);
 	}
+	G_percent(1, 1, 1);
 
 	G_debug(3, "SQL: %s", buf2);
 	db_set_string(&stmt, buf2);



More information about the grass-commit mailing list