[GRASS-SVN] r34673 - in grass/branches/develbranch_6: include lib/gis vector/v.category vector/v.edit

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 2 12:32:35 EST 2008


Author: martinl
Date: 2008-12-02 12:32:35 -0500 (Tue, 02 Dec 2008)
New Revision: 34673

Modified:
   grass/branches/develbranch_6/include/gis.h
   grass/branches/develbranch_6/lib/gis/parser.c
   grass/branches/develbranch_6/vector/v.category/main.c
   grass/branches/develbranch_6/vector/v.edit/args.c
Log:
gislib: add G_OPT_V_ID(S)


Modified: grass/branches/develbranch_6/include/gis.h
===================================================================
--- grass/branches/develbranch_6/include/gis.h	2008-12-02 16:53:08 UTC (rev 34672)
+++ grass/branches/develbranch_6/include/gis.h	2008-12-02 17:32:35 UTC (rev 34673)
@@ -189,6 +189,8 @@
     G_OPT_V_FIELD,		/* layer number (layers used to be called fields) */
     G_OPT_V_CAT,		/* one category */
     G_OPT_V_CATS,		/* more categories */
+    G_OPT_V_ID, 		/* one feature id */
+    G_OPT_V_IDS,		/* more feature ids */
 
     G_OPT_F_INPUT,		/* old input file */
     G_OPT_F_OUTPUT,		/* new output file */

Modified: grass/branches/develbranch_6/lib/gis/parser.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/parser.c	2008-12-02 16:53:08 UTC (rev 34672)
+++ grass/branches/develbranch_6/lib/gis/parser.c	2008-12-02 17:32:35 UTC (rev 34673)
@@ -591,6 +591,20 @@
 	Opt->label = _("Category values");
 	Opt->description = _("Example: 1,3,7-9,13");
 	break;
+    case G_OPT_V_ID:
+	Opt->key = "id";
+	Opt->type = TYPE_INTEGER;
+	Opt->required = NO;
+	Opt->description = _("Feature id");
+	break;
+    case G_OPT_V_IDS:
+	Opt->key = "ids";
+	Opt->type = TYPE_STRING;
+	Opt->key_desc = "range";
+	Opt->required = NO;
+	Opt->label = _("Feature ids");
+	Opt->description = _("Example: 1,3,7-9,13");
+	break;
 
 	/* files */
     case G_OPT_F_INPUT:

Modified: grass/branches/develbranch_6/vector/v.category/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.category/main.c	2008-12-02 16:53:08 UTC (rev 34672)
+++ grass/branches/develbranch_6/vector/v.category/main.c	2008-12-02 17:32:35 UTC (rev 34673)
@@ -96,11 +96,8 @@
     field_opt->multiple = YES;
     field_opt->guisection = _("Selection");
 
-    id_opt = G_define_standard_option(G_OPT_V_CAT);
-    id_opt->multiple = YES;
-    id_opt->label = _("Feature id(s)");
-    id_opt->description = _("By default all ids are processed");
-    id_opt->key = "id";
+    id_opt = G_define_standard_option(G_OPT_V_IDS);
+    id_opt->label = _("Feature ids (by default all features are processed)");
     id_opt->guisection = _("Selection");
 
     cat_opt = G_define_standard_option(G_OPT_V_CAT);

Modified: grass/branches/develbranch_6/vector/v.edit/args.c
===================================================================
--- grass/branches/develbranch_6/vector/v.edit/args.c	2008-12-02 16:53:08 UTC (rev 34672)
+++ grass/branches/develbranch_6/vector/v.edit/args.c	2008-12-02 17:32:35 UTC (rev 34673)
@@ -38,6 +38,7 @@
     params->map->description = _("Name of vector map to edit");
 
     params->fld = G_define_standard_option(G_OPT_V_FIELD);
+    params->fld->gisprompt = "new_layer,layer,layer";
     params->fld->guisection = _("Selection");
 
     params->type = G_define_standard_option(G_OPT_V_TYPE);
@@ -120,13 +121,9 @@
 	_("'-1' for threshold based on the current resolution settings");
     params->maxdist->answer = "-1,0,0";
 
-    params->id = G_define_standard_option(G_OPT_V_CATS);
-    params->id->required = NO;
-    params->id->key = "ids";
-    params->id->label = _("ID values");
+    params->id = G_define_standard_option(G_OPT_V_IDS);
     params->id->guisection = _("Selection");
 
-
     params->cat = G_define_standard_option(G_OPT_V_CATS);
     params->cat->required = NO;
     params->cat->guisection = _("Selection");
@@ -202,13 +199,8 @@
     params->reverse = G_define_flag();
     params->reverse->key = 'r';
     params->reverse->description = _("Reverse selection");
+    params->reverse->guisection = _("Selection");
 
-    /*
-       params -> print = G_define_flag();
-       params -> print -> key = 'i';
-       params -> print -> description = _("Print ID's of edited features");
-     */
-
     params->close = G_define_flag();
     params->close->key = 'c';
     params->close->description =
@@ -228,16 +220,6 @@
     params->move_first->description =
 	_("Modify only first found feature in bounding box");
 
-    /*
-       params -> boundary = G_define_flag();
-       params -> boundary -> key = 'b';
-       params -> boundary -> description = _("Assign cats to boundaries too");
-
-       params -> print_cat = G_define_flag();
-       params -> print_cat -> key = 'c';
-       params -> print_cat -> description = _("Print category numbers instead of ID's");
-     */
-
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 



More information about the grass-commit mailing list