[GRASS-SVN] r39832 - grass/trunk/vector/v.kcv

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 27 14:10:36 EST 2009


Author: martinl
Date: 2009-11-27 14:10:36 -0500 (Fri, 27 Nov 2009)
New Revision: 39832

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


Modified: grass/trunk/vector/v.kcv/main.c
===================================================================
--- grass/trunk/vector/v.kcv/main.c	2009-11-27 19:05:17 UTC (rev 39831)
+++ grass/trunk/vector/v.kcv/main.c	2009-11-27 19:10:36 UTC (rev 39832)
@@ -52,7 +52,7 @@
     static struct line_pnts *Points;
     struct line_cats *Cats;
     struct GModule *module;
-    struct Option *in_opt, *out_opt, *col_opt, *npart_opt;
+    struct Option *in_opt, *out_opt, *col_opt, *npart_opt, *field_opt;
     struct Flag *drand48_flag;
     struct bound_box box;
     double maxdist;
@@ -71,6 +71,9 @@
 	_("Randomly partition points into test/train sets.");
 
     in_opt = G_define_standard_option(G_OPT_V_INPUT);
+
+    field_opt = G_define_standard_option(G_OPT_V_FIELD);
+
     out_opt = G_define_standard_option(G_OPT_V_OUTPUT);
 
     npart_opt = G_define_option();
@@ -116,7 +119,7 @@
 
     /* open input vector */
     Vect_set_open_level(2);
-    if (Vect_open_old(&In, in_opt->answer, "") < 2) {
+    if (Vect_open_old2(&In, in_opt->answer, "", field_opt->answer) < 2) {
 	G_fatal_error(_("Unable to open vector map <%s> at topological level %d"),
 		      in_opt->answer, 2);
     }
@@ -137,7 +140,7 @@
     Vect_hist_command(&Out);
 
     /* Copy vector lines */
-    Vect_copy_map_lines(&In, &Out);
+    Vect_copy_map_lines_field(&In, Vect_get_field_number(&In, field_opt->answer), &Out);
 
     /* Copy tables */
     if (Vect_copy_tables(&In, &Out, 0))



More information about the grass-commit mailing list