[GRASS-SVN] r39538 - grass/trunk/vector/v.db.connect

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 17 06:22:24 EDT 2009


Author: martinl
Date: 2009-10-17 06:22:23 -0400 (Sat, 17 Oct 2009)
New Revision: 39538

Modified:
   grass/trunk/vector/v.db.connect/main.c
Log:
v.db.connect: initial support for OGR (-p/-g)


Modified: grass/trunk/vector/v.db.connect/main.c
===================================================================
--- grass/trunk/vector/v.db.connect/main.c	2009-10-17 10:10:36 UTC (rev 39537)
+++ grass/trunk/vector/v.db.connect/main.c	2009-10-17 10:22:23 UTC (rev 39538)
@@ -7,7 +7,7 @@
  *               
  * PURPOSE:      sets/prints DB connection for a given vector map
  *               
- * COPYRIGHT:    (C) 2002-2008 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2002-2009 by the GRASS Development Team
  *
  *               This program is free software under the 
  *               GNU General Public License (>=v2). 
@@ -138,8 +138,10 @@
     if (print->answer && shell_print->answer)
 	G_fatal_error(_("Please choose only one print style"));
 
-    if (print->answer || shell_print->answer || columns->answer)
-	Vect_open_old(&Map, inopt->answer, "");
+    if (print->answer || shell_print->answer || columns->answer) {
+	Vect_set_open_level(1); /* no topology needed */
+	Vect_open_old2(&Map, inopt->answer, "", field_opt->answer);
+    }
     else {
 	if (Vect_open_update_head(&Map, inopt->answer, G_mapset()) < 1)
 	    G_fatal_error(_("Unable to modify vector map stored in other mapset"));
@@ -196,8 +198,8 @@
 	    else {		/* columns */
 
 		if ((fi = Vect_get_field(&Map, field)) == NULL)
-		    G_fatal_error(_("Database connection not defined for layer %d"),
-				  field);
+		    G_fatal_error(_("Database connection not defined for layer <%s>"),
+				  field_opt->answer);
 		driver = db_start_driver(fi->driver);
 		if (driver == NULL)
 		    G_fatal_error(_("Unable to start driver <%s>"),



More information about the grass-commit mailing list