[GRASS-SVN] r39883 - grass/trunk/vector/v.out.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 3 14:31:13 EST 2009


Author: martinl
Date: 2009-12-03 14:31:13 -0500 (Thu, 03 Dec 2009)
New Revision: 39883

Modified:
   grass/trunk/vector/v.out.ogr/main.c
Log:
v.out.ogr: OGR support (read access)


Modified: grass/trunk/vector/v.out.ogr/main.c
===================================================================
--- grass/trunk/vector/v.out.ogr/main.c	2009-12-03 19:11:50 UTC (rev 39882)
+++ grass/trunk/vector/v.out.ogr/main.c	2009-12-03 19:31:13 UTC (rev 39883)
@@ -82,13 +82,12 @@
     G_add_keyword(_("ogr"));
 
     module->description =
-	_("Converts GRASS vector map to one of the supported OGR vector formats.");
+	_("Converts vector map to one of the supported OGR vector formats.");
     
     /* parse & read options */
     parse_args(argc, argv,
 	       &options, &flags);
-    field = atoi(options.field->answer);
-
+    
     /* parse dataset creation options */
     i = 0;
     while (options.dsco->answers[i]) {
@@ -117,7 +116,7 @@
     if (!flags.new->answer) {
 	/* open input vector (topology required) */
 	Vect_set_open_level(2);
-	Vect_open_old(&In, options.input->answer, "");
+	Vect_open_old2(&In, options.input->answer, "", options.field->answer);
 	
 	if (strcmp(options.type->answer, "auto") == 0) {
 	    G_debug(2, "Automatic type determination.");
@@ -169,6 +168,8 @@
 		G_fatal_error(_("Unable to determine input map's vector feature type(s)."));
 	}
     }
+
+    field = Vect_get_field_number(&In, options.field->answer);
     
     /* check output feature type */
     otype = Vect_option_to_types(options.type);
@@ -821,7 +822,6 @@
     }
 
     /* Summary */
-    G_message(_("%d features written"), fout);
     if (nocat > 0)
 	G_warning(_("%d features without category were written"), nocat);
     if (noatt > 0)
@@ -838,7 +838,8 @@
        G_warning ("%d features of different type skip", fskip);
      */
 
-    G_done_msg(" ");
+    G_done_msg(_("%d features written to <%s> (%s)."), fout,
+	       options.layer->answer, options.format->answer);
     
     exit(EXIT_SUCCESS);
 }



More information about the grass-commit mailing list