[GRASS-SVN] r39839 - grass/trunk/vector/v.normal

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 27 17:54:02 EST 2009


Author: martinl
Date: 2009-11-27 17:54:01 -0500 (Fri, 27 Nov 2009)
New Revision: 39839

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


Modified: grass/trunk/vector/v.normal/main.c
===================================================================
--- grass/trunk/vector/v.normal/main.c	2009-11-27 22:49:17 UTC (rev 39838)
+++ grass/trunk/vector/v.normal/main.c	2009-11-27 22:54:01 UTC (rev 39839)
@@ -46,7 +46,7 @@
     struct GModule *module;
     struct
     {
-	struct Option *input, *tests, *dfield;
+	struct Option *input, *tests, *dfield, *layer;
     } parm;
     struct
     {
@@ -78,6 +78,8 @@
 
     parm.input = G_define_standard_option(G_OPT_V_MAP);
 
+    parm.layer = G_define_standard_option(G_OPT_V_FIELD);
+    
     parm.tests = G_define_option();
     parm.tests->key = "tests";
     parm.tests->key_desc = "range";
@@ -105,8 +107,8 @@
 
     /* Open input */
     Vect_set_open_level(2);
-    Vect_open_old(&Map, parm.input->answer, "");
-    field = 1;
+    Vect_open_old2(&Map, parm.input->answer, "", parm.layer->answer);
+    field = Vect_get_field_number(&Map, parm.layer->answer);
     
     /* Read attributes */
     Fi = Vect_get_field(&Map, field);



More information about the grass-commit mailing list