Skip to content

Commit c8c7851

Browse files
committedApr 24, 2013
[sextante] wrap long lines in help file
1 parent 69afcf2 commit c8c7851

File tree

1 file changed

+52
-32
lines changed

1 file changed

+52
-32
lines changed
 
Lines changed: 52 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
11
A short guide for creating and editing GRASS algorithms for SEXTANTE:
22
-----------------------------------------------------------------------
33

4-
Each GRASS command, to be executed from a SEXTANTE element such as the toolbox or the graphical modeler, needs to be described to let SEXTANTE know the inputs required by the commands, the output it generates and the parameters that are used to configure it. Each command is described in a separate text file, although some commands might be split in several algorithms, needing thus several files and adding more than one new entry to the algorithms list of SEXTANTE. Splitting a grassc ommand is usually done because SEXTANTE does not support optional parameters, so it will call GRASS using all parameters defined in the description file.
5-
6-
Here is an explanation of the content of these descriptions files, so you can create you own ones or edit current ones to improve them.
4+
Each GRASS command, to be executed from a SEXTANTE element such as the toolbox
5+
or the graphical modeler, needs to be described to let SEXTANTE know the inputs
6+
required by the commands, the output it generates and the parameters that are
7+
used to configure it. Each command is described in a separate text file, although
8+
some commands might be split in several algorithms, needing thus several files
9+
and adding more than one new entry to the algorithms list of SEXTANTE. Splitting
10+
a grassc ommand is usually done because SEXTANTE does not support optional
11+
parameters, so it will call GRASS using all parameters defined in the description
12+
file.
13+
14+
Here is an explanation of the content of these descriptions files, so you can
15+
create you own ones or edit current ones to improve them.
716

817
Each file starts with three lines containing:
918

10-
-The name of the grass command to call to execute the algorithm (e.g. v.buffer)
11-
-The name of the algorithm to show to the user. This is usually the same as the grass command, but it can be different
12-
-The name of the group where you want the command to appear
19+
- The name of the grass command to call to execute the algorithm (e.g. v.buffer)
20+
- The name of the algorithm to show to the user. This is usually the same as the
21+
GRASS command, but it can be different
22+
- The name of the group where you want the command to appear
1323

14-
After this three lines, a variable number of lines appear, describing all inputs and ouputs. Here is a brief explanation of the format of these lines, depending on the type of parameter or output to be described. All declarations are contained in a single line, with elements separated by the symbol "|"
24+
After this three lines, a variable number of lines appear, describing all inputs
25+
and ouputs. Here is a brief explanation of the format of these lines, depending
26+
on the type of parameter or output to be described. All declarations are contained
27+
in a single line, with elements separated by the symbol "|"
1528

16-
-A raster layer
29+
- A raster layer
1730
ParameterRaster|base|base|False
1831

1932
ParameterRaster|[name of GRASS parameter]|[description of parameter to show]|True/False, indicating if the parameter is optional or not
2033

2134
Example: ParameterRaster|base|base|False
2235

23-
-A vector layer
36+
- A vector layer
2437

2538
ParameterVector|[name of GRASS parameter]|[description of parameter to shown]|[A number indicating the type of geometry]|True/False, indicating if the parameter is optional or not
2639

@@ -33,62 +46,69 @@ To indicate the type of geometry, use the following values:
3346
1: lines
3447
2: polygons
3548

36-
-A numerical value
49+
- A numerical value
3750

3851
ParameterNumericalValue|[name of GRASS parameter]|[description of parameter to show]|[min value]|[max value]|[default value]
3952

40-
"None" can be used for both min and max values to indicate that there is no lower or upper limit.
53+
"None" can be used for both min and max values to indicate that there is no lower
54+
or upper limit.
4155

42-
If the default value is written as a real number (i.e. it contains a decimal point, even if it is an integer value like 4.0), the parameter can take any value, including decimal ones. If it is written as an integer (i.e. 4), the parameter is assumed to accept only integer values
56+
If the default value is written as a real number (i.e. it contains a decimal
57+
point, even if it is an integer value like 4.0), the parameter can take any value,
58+
including decimal ones. If it is written as an integer (i.e. 4), the parameter is
59+
assumed to accept only integer values
4360

4461
Example: ParameterNumber|levels|levels|1|256|32
4562

46-
-A string
63+
- A string
4764

4865
ParameterString|[name of GRASS parameter]|[description of parameter to show]|[default value]
4966

50-
-A value to select from a list
67+
- A value to select from a list
5168

5269
ParameterSelection|[name of GRASS parameter]|[description of parameter to show]|[list of possible values, separated by semicolons]|[zero-based index of default value]
5370

54-
-A boolean value
71+
- A boolean value
5572

5673
Example: ParameterBoolean|-c|-c|True
5774

58-
-Outputs
75+
- Outputs
5976

6077
All outputs are added with the following syntax:
6178

6279
[type of output]|[name of GRASS output]|[description of output to show]
6380

6481
The following types are available
6582

66-
-OutputRaster
67-
-OutputVector
68-
-OutputTable
69-
-OutputFile (for any file that is not a layer or table of a format supported by QGIS)
83+
-OutputRaster
84+
-OutputVector
85+
-OutputTable
86+
-OutputFile (for any file that is not a layer or table of a format supported by QGIS)
7087

7188

72-
-Advanced parameters
89+
- Advanced parameters
7390

7491
to tag a parameter as "advanced", just add "*" before its declaration. For instance:
7592

7693
*ParameterBoolean|-c|-c|True
7794

7895

7996
ADVANCED OUTPUT PROCESSING
80-
-------------------------
97+
--------------------------
8198

82-
In some cases, it might be interesting to take the console otput from GRASS and extract a part of it for saving or formatting.
99+
In some cases, it might be interesting to take the console otput from GRASS and
100+
extract a part of it for saving or formatting.
83101

84102
Two things can be done about this:
85103

86-
-Creating an HTML file with output. Just add an output of type OutputHTML.
87-
It's value will not be passed to GRASS, but you can use it later to create the HTML file from the console output.
88-
You should create a python file in the grass/ext package, with the same name as the grass module, with dots replaced by low hyphens
89-
(for instance r_quantile.py for the r.quantile command), and add a postProcessResults(alg) method. It will be called when the
90-
execution of the GRASS command is finished.
91-
-Creating a text file. Do as above, but adding an otput of type OutputFile. Since some GRASS commands might use this type of output,
92-
and to make sure that the value of this output is not passed to the GRASS comman when calling it, the output has to be named 'outputtext'
93-
94-
104+
- Creating an HTML file with output. Just add an output of type OutputHTML.
105+
It's value will not be passed to GRASS, but you can use it later to create the
106+
HTML file from the console output. You should create a python file in the
107+
grass/ext package, with the same name as the grass module, with dots replaced
108+
by low hyphens (for instance r_quantile.py for the r.quantile command), and
109+
add a postProcessResults(alg) method. It will be called when the execution of
110+
the GRASS command is finished.
111+
- Creating a text file. Do as above, but adding an otput of type OutputFile.
112+
Since some GRASS commands might use this type of output, and to make sure that
113+
the value of this output is not passed to the GRASS comman when calling it,
114+
the output has to be named 'outputtext'

0 commit comments

Comments
 (0)
Please sign in to comment.