[GRASS-SVN] r39978 - grass/trunk/vector/v.build

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 11 07:10:55 EST 2009


Author: mmetz
Date: 2009-12-11 07:10:54 -0500 (Fri, 11 Dec 2009)
New Revision: 39978

Modified:
   grass/trunk/vector/v.build/main.c
Log:
v.build: open vector map as old, avoid rewriting the files coor, hist, dbln, and head

Modified: grass/trunk/vector/v.build/main.c
===================================================================
--- grass/trunk/vector/v.build/main.c	2009-12-11 11:42:13 UTC (rev 39977)
+++ grass/trunk/vector/v.build/main.c	2009-12-11 12:10:54 UTC (rev 39978)
@@ -27,6 +27,7 @@
     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 @@
 
     /* 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);



More information about the grass-commit mailing list