瀏覽代碼

v.build: open vector map as old, avoid rewriting the files coor, hist, dbln, and head

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39978 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 15 年之前
父節點
當前提交
0c3bc2f078
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      vector/v.build/main.c

+ 11 - 2
vector/v.build/main.c

@@ -27,6 +27,7 @@ int main(int argc, char *argv[])
     struct Option *map_opt, *opt, *err_opt;
     struct Map_info Map;
     int i, build = 0, dump = 0, sdump = 0, cdump = 0;
+    char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
 
     G_gisinit(argv[0]);
 
@@ -80,9 +81,17 @@ int main(int argc, char *argv[])
 
     /* build topology */
     if (build) {
+	if (G_name_is_fully_qualified(map_opt->answer, xname, xmapset)) {
+	    if (0 != strcmp(xmapset, G_mapset())) {
+		G_fatal_error(_("Vector map <%s> is not in current mapset"),
+			      map_opt->answer);
+		exit(EXIT_FAILURE);
+	    }
+	}
 	Vect_set_open_level(1);
-	if (Vect_open_update(&Map, map_opt->answer, G_mapset()) < 0) {
-	    G_fatal_error(_("Unable to build topology for <%s>"), map_opt->answer);
+	if (Vect_open_old(&Map, map_opt->answer, G_mapset()) < 0) {
+	    G_fatal_error(_("Unable to build topology for <%s>"),
+			  map_opt->answer);
 	    exit(EXIT_FAILURE);
 	}
 	Vect_build(&Map);