فهرست منبع

Bug fixing and a new standard option

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50922 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 13 سال پیش
والد
کامیت
31e6372d9c
3فایلهای تغییر یافته به همراه20 افزوده شده و 7 حذف شده
  1. 2 0
      general/g.parser/standard_option.c
  2. 1 0
      include/gis.h
  3. 17 7
      lib/gis/parser_standard_options.c

+ 2 - 0
general/g.parser/standard_option.c

@@ -146,6 +146,8 @@ struct Option *define_standard_option(const char *name)
 	key = G_OPT_T_TYPE;
     else if (G_strcasecmp(name, "G_OPT_T_WHERE") == 0)
 	key = G_OPT_T_WHERE;
+    else if (G_strcasecmp(name, "G_OPT_T_SAMPLE") == 0)
+	key = G_OPT_T_SAMPLE;
 
     if (key == G_OPT_UNDEFINED)
 	opt = G_define_option();

+ 1 - 0
include/gis.h

@@ -249,6 +249,7 @@ static const char *GRASS_copyright __attribute__ ((unused))
     G_OPT_MAP_TYPE,             /* The type of an input map: raster, vect, rast3d */
     G_OPT_T_TYPE,               /* The temporal type of a space time dataset */
     G_OPT_T_WHERE,              /* A temporal GIS framework SQL WHERE statement */
+    G_OPT_T_SAMPLE,             /* Temporal sample methods */
 
 } STD_OPT;
 

+ 17 - 7
lib/gis/parser_standard_options.c

@@ -709,7 +709,7 @@ struct Option *G_define_standard_option(int opt)
 	Opt->key_desc = "name";
 	Opt->required = NO;
 	Opt->answer = "strds";
-	Opt->answer = "strds,stvds,str3ds";
+	Opt->options = "strds,stvds,str3ds";
 	Opt->description = _("Type of the input space time dataset");
 	break;
     case G_OPT_MAP_INPUT:
@@ -721,7 +721,7 @@ struct Option *G_define_standard_option(int opt)
 	Opt->description = _("Name of the input map");
 	break;
     case G_OPT_MAP_INPUTS:
-	Opt->key = "map";
+	Opt->key = "maps";
 	Opt->type = TYPE_STRING;
 	Opt->key_desc = "name";
 	Opt->required = YES;
@@ -735,28 +735,38 @@ struct Option *G_define_standard_option(int opt)
 	Opt->key_desc = "name";
 	Opt->required = NO;
 	Opt->answer = "rast";
-	Opt->answer = "rast,vect,rast3d";
+	Opt->options = "rast,vect,rast3d";
 	Opt->description = _("Type of the input map");
 	break;
     case G_OPT_T_TYPE:
-	Opt->key = "t_type";
+	Opt->key = "temporaltype";
 	Opt->type = TYPE_STRING;
 	Opt->key_desc = "name";
 	Opt->required = NO;
 	Opt->answer = "absolute";
-	Opt->answer = "absolute,relative";
+	Opt->options = "absolute,relative";
 	Opt->description = _("The temporal type of the space time dataset");
 	break;
     case G_OPT_T_WHERE:
-	Opt->key = "t_where";
+	Opt->key = "where";
 	Opt->type = TYPE_STRING;
 	Opt->key_desc = "sql_query";
 	Opt->required = NO;
 	Opt->label = _("WHERE conditions of SQL statement without 'where' keyword used in the temporal GIS framework");
 	Opt->description = _("Example: start_time > '2001-01-01 12:30:00'");
 	break;
+    case G_OPT_T_SAMPLE:
+	Opt->key = "sampling";
+	Opt->type = TYPE_STRING;
+	Opt->key_desc = "name";
+	Opt->required = NO;
+	Opt->multiple = YES;
+	Opt->answer = "start";
+	Opt->options = "start,during,overlap,contain,equal";
+	Opt->description = _("The method to be used for sampling the input dataset");
+	break;
     }
-
+    
     return Opt;
 }