Sfoglia il codice sorgente

v.to.db: fix qlayer
(merge from devbr6, https://trac.osgeo.org/grass/changeset/34906)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@34907 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 anni fa
parent
commit
d37132c8dc
1 ha cambiato i file con 7 aggiunte e 5 eliminazioni
  1. 7 5
      vector/v.to.db/update.c

+ 7 - 5
vector/v.to.db/update.c

@@ -42,10 +42,10 @@ int update(struct Map_info *Map)
 
 
     db_begin_transaction(driver);
     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);
     G_debug(3, "Existing categories: %d", vstat.select);
-
+    
     /* create beginning of stmt */
     /* create beginning of stmt */
     switch (options.option) {
     switch (options.option) {
     case O_CAT:
     case O_CAT:
@@ -73,7 +73,9 @@ int update(struct Map_info *Map)
     /* update */
     /* update */
     G_message(_("Updating database..."));
     G_message(_("Updating database..."));
     for (i = 0; i < vstat.rcat; i++) {
     for (i = 0; i < vstat.rcat; i++) {
-	fcat = Values[i].cat;
+	G_percent(i, vstat.rcat, 2);
+
+	fcat = Values[i].cat;	
 	if (fcat < 0)
 	if (fcat < 0)
 	    continue;
 	    continue;
 	switch (options.option) {
 	switch (options.option) {
@@ -184,8 +186,8 @@ int update(struct Map_info *Map)
 		    break;
 		    break;
 		}
 		}
 	    }
 	    }
-	    G_percent(i + 1, vstat.rcat, 2);
 	}
 	}
+	G_percent(1, 1, 1);
 
 
 	G_debug(3, "SQL: %s", buf2);
 	G_debug(3, "SQL: %s", buf2);
 	db_set_string(&stmt, buf2);
 	db_set_string(&stmt, buf2);