[GRASS-SVN] r58766 - in grass/trunk: lib/gis temporal/t.rast.accdetect temporal/t.rast.accumulate temporal/t.rast.aggregate temporal/t.rast.aggregate.ds temporal/t.rast.extract temporal/t.rast.gapfill temporal/t.rast.import temporal/t.rast.mapcalc temporal/t.rast.neighbors temporal/t.rast3d.mapcalc temporal/t.vect.extract
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 22 15:45:31 PST 2014
Author: huhabla
Date: 2014-01-22 15:45:29 -0800 (Wed, 22 Jan 2014)
New Revision: 58766
Modified:
grass/trunk/lib/gis/parser_wps.c
grass/trunk/temporal/t.rast.accdetect/t.rast.accdetect.py
grass/trunk/temporal/t.rast.accumulate/t.rast.accumulate.py
grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py
grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py
grass/trunk/temporal/t.rast.extract/t.rast.extract.py
grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py
grass/trunk/temporal/t.rast.import/t.rast.import.py
grass/trunk/temporal/t.rast.mapcalc/t.rast.mapcalc.py
grass/trunk/temporal/t.rast.neighbors/t.rast.neighbors.py
grass/trunk/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py
grass/trunk/temporal/t.vect.extract/t.vect.extract.py
Log:
Better basename options for temporal modules, better title and abstract support for wps services
Modified: grass/trunk/lib/gis/parser_wps.c
===================================================================
--- grass/trunk/lib/gis/parser_wps.c 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/lib/gis/parser_wps.c 2014-01-22 23:45:29 UTC (rev 58766)
@@ -342,10 +342,15 @@
else
max = 1;
}
-
+
+ if(opt->label) {
+ title = opt->label;
+ }
if (opt->description) {
- title = opt->description;
- abstract = opt->description;
+ if(!opt->label)
+ title = opt->description;
+ else
+ abstract = opt->description;
}
if (opt->def) {
value = opt->def;
@@ -367,12 +372,13 @@
data_type == TYPE_STDS || data_type == TYPE_PLAIN_TEXT)
{
/* 2048 is the maximum size of the map in mega bytes */
- wps_print_complex_input(min, max, identifier, title, NULL, 2048, data_type);
+ wps_print_complex_input(min, max, identifier, title, abstract, 2048, data_type);
}
else
{
/* The keyword array is missused for options, type means the type of the value (integer, float ... )*/
- wps_print_literal_input_output(WPS_INPUT, min, max, identifier, title, NULL, type, 0, keywords, num_keywords, value, TYPE_OTHER);
+ wps_print_literal_input_output(WPS_INPUT, min, max, identifier, title,
+ abstract, type, 0, keywords, num_keywords, value, TYPE_OTHER);
}
}
opt = opt->next_opt;
@@ -477,18 +483,27 @@
}
G_free(top);
}
- /* Only single module output is supported */
- if(is_output == 1 && opt->multiple == NO)
+ /* Only single module output is supported!! */
+ if(is_output == 1)
{
+ if(opt->multiple == YES)
+ G_warning(_("Multiple outputs are not supported by WPS 1.0.0"));
identifier = opt->key;
+
+ if(opt->label) {
+ title = opt->label;
+ }
if (opt->description) {
- title = opt->description;
- abstract = opt->description;
- }
+ if(!opt->label)
+ title = opt->description;
+ else
+ abstract = opt->description;
+ }
+
if(data_type == TYPE_RASTER || data_type == TYPE_VECTOR ||
data_type == TYPE_STRDS || data_type == TYPE_STVDS ||
data_type == TYPE_STDS || data_type == TYPE_PLAIN_TEXT) {
- wps_print_complex_output(identifier, title, NULL, data_type);
+ wps_print_complex_output(identifier, title, abstract, data_type);
found_output = 1;
}
}
Modified: grass/trunk/temporal/t.rast.accdetect/t.rast.accdetect.py
===================================================================
--- grass/trunk/temporal/t.rast.accdetect/t.rast.accdetect.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast.accdetect/t.rast.accdetect.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -79,7 +79,14 @@
#% multiple: no
#%end
-#%option G_OPT_R_BASE
+#%option
+#% key: basename
+#% type: string
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
+#% required: yes
+#% multiple: no
+#% gisprompt:
#%end
#%option
@@ -124,7 +131,7 @@
input = options["input"]
start = options["start"]
stop = options["stop"]
- base = options["base"]
+ base = options["basename"]
cycle = options["cycle"]
offset = options["offset"]
minimum = options["minimum"]
Modified: grass/trunk/temporal/t.rast.accumulate/t.rast.accumulate.py
===================================================================
--- grass/trunk/temporal/t.rast.accumulate/t.rast.accumulate.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast.accumulate/t.rast.accumulate.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -80,7 +80,14 @@
#% multiple: no
#%end
-#%option G_OPT_R_BASE
+#%option
+#% key: basename
+#% type: string
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
+#% required: yes
+#% multiple: no
+#% gisprompt:
#%end
#%option
@@ -141,7 +148,7 @@
output = options["output"]
start = options["start"]
stop = options["stop"]
- base = options["base"]
+ base = options["basename"]
cycle = options["cycle"]
lower = options["lower"]
upper = options["upper"]
Modified: grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py
===================================================================
--- grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -26,7 +26,14 @@
#%option G_OPT_STRDS_OUTPUT
#%end
-#%option G_OPT_R_BASE
+#%option
+#% key: basename
+#% type: string
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
+#% required: yes
+#% multiple: no
+#% gisprompt:
#%end
#%option
@@ -71,7 +78,7 @@
output = options["output"]
where = options["where"]
gran = options["granularity"]
- base = options["base"]
+ base = options["basename"]
register_null = flags["n"]
method = options["method"]
sampling = options["sampling"]
Modified: grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py
===================================================================
--- grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -35,7 +35,13 @@
#%option G_OPT_STRDS_OUTPUT
#%end
-#%option G_OPT_R_BASE
+#%option
+#% key: basename
+#% type: string
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
+#% required: yes
+#% multiple: no
#% gisprompt:
#%end
@@ -69,7 +75,7 @@
input = options["input"]
output = options["output"]
sampler = options["sample"]
- base = options["base"]
+ base = options["basename"]
register_null = flags["n"]
method = options["method"]
type = options["type"]
Modified: grass/trunk/temporal/t.rast.extract/t.rast.extract.py
===================================================================
--- grass/trunk/temporal/t.rast.extract/t.rast.extract.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast.extract/t.rast.extract.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -38,9 +38,10 @@
#%end
#%option
-#% key: base
+#% key: basename
#% type: string
-#% description: The base name of the new created raster maps. This name will be extended with a numerical prefix
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: no
#% multiple: no
#% gisprompt:
@@ -74,7 +75,7 @@
output = options["output"]
where = options["where"]
expression = options["expression"]
- base = options["base"]
+ base = options["basename"]
nprocs = int(options["nprocs"])
register_null = flags["n"]
Modified: grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py
===================================================================
--- grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -27,11 +27,13 @@
#%end
#%option
-#% key: base
+#% key: basename
#% type: string
-#% description: Base name of the interpolated raster maps. This name will be extended with a numerical prefix
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
+#% gisprompt:
#%end
#%option
@@ -59,7 +61,7 @@
# Get the options
input = options["input"]
- base = options["base"]
+ base = options["basename"]
where = options["where"]
nprocs = options["nprocs"]
Modified: grass/trunk/temporal/t.rast.import/t.rast.import.py
===================================================================
--- grass/trunk/temporal/t.rast.import/t.rast.import.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast.import/t.rast.import.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -26,6 +26,16 @@
#%option G_OPT_STRDS_OUTPUT
#%end
+#%option
+#% key: basename
+#% type: string
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
+#% required: no
+#% multiple: no
+#% gisprompt:
+#%end
+
#%option G_OPT_M_DIR
#% key: extrdir
#% description: Path to the extraction directory
@@ -75,9 +85,6 @@
#% description: Override projection (use location's projection)
#%end
-#%option G_OPT_R_BASE
-#% required: no
-#%end
#%flag
#% key: c
@@ -97,7 +104,7 @@
title = options["title"]
descr = options["description"]
location = options["location"]
- base = options["base"]
+ base = options["basename"]
set_current_region = flags["r"]
link = flags["l"]
exp = flags["e"]
Modified: grass/trunk/temporal/t.rast.mapcalc/t.rast.mapcalc.py
===================================================================
--- grass/trunk/temporal/t.rast.mapcalc/t.rast.mapcalc.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast.mapcalc/t.rast.mapcalc.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -40,12 +40,13 @@
#%end
#%option
-#% key: base
+#% key: basename
#% type: string
-#% description: Base name of the new created raster maps. This name will be extended with a numerical prefix
-#% gisprompt: NULL
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
+#% gisprompt:
#%end
#%option
@@ -81,7 +82,7 @@
inputs = options["inputs"]
output = options["output"]
expression = options["expression"]
- base = options["base"]
+ base = options["basename"]
method = options["method"]
nprocs = int(options["nprocs"])
register_null = flags["n"]
Modified: grass/trunk/temporal/t.rast.neighbors/t.rast.neighbors.py
===================================================================
--- grass/trunk/temporal/t.rast.neighbors/t.rast.neighbors.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast.neighbors/t.rast.neighbors.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -49,7 +49,14 @@
#% answer: average
#%end
-#%option G_OPT_R_BASE
+#%option
+#% key: basename
+#% type: string
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
+#% required: yes
+#% multiple: no
+#% gisprompt:
#%end
#%option
@@ -81,7 +88,7 @@
output = options["output"]
where = options["where"]
size = options["size"]
- base = options["base"]
+ base = options["basename"]
register_null = flags["n"]
method = options["method"]
nprocs = options["nprocs"]
Modified: grass/trunk/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py
===================================================================
--- grass/trunk/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -40,11 +40,13 @@
#%end
#%option
-#% key: base
+#% key: basename
#% type: string
-#% description: Base name of the new created 3d raster maps. This name will be extended with a numerical prefix
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: yes
#% multiple: no
+#% gisprompt:
#%end
#%option
@@ -80,7 +82,7 @@
inputs = options["inputs"]
output = options["output"]
expression = options["expression"]
- base = options["base"]
+ base = options["basename"]
method = options["method"]
nprocs = int(options["nprocs"])
register_null = flags["n"]
Modified: grass/trunk/temporal/t.vect.extract/t.vect.extract.py
===================================================================
--- grass/trunk/temporal/t.vect.extract/t.vect.extract.py 2014-01-22 18:58:40 UTC (rev 58765)
+++ grass/trunk/temporal/t.vect.extract/t.vect.extract.py 2014-01-22 23:45:29 UTC (rev 58766)
@@ -40,11 +40,13 @@
#%end
#%option
-#% key: base
+#% key: basename
#% type: string
-#% description: Base name of the new created vector maps
+#% label: Base name of the new generated output maps"
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
#% required: no
#% multiple: no
+#% gisprompt:
#%end
#%option
@@ -77,7 +79,7 @@
expression = options["expression"]
layer = options["layer"]
type = options["type"]
- base = options["base"]
+ base = options["basename"]
nprocs = int(options["nprocs"])
register_null = flags["n"]
More information about the grass-commit
mailing list