Skip to content
Permalink
Browse files
moved grass.txt
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@170 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf committed May 7, 2012
1 parent ccdf076 commit 3107d16557d1b660f2dfecdd5d7ded4bbb290acf
Showing with 39 additions and 4 deletions.
  1. +39 −4 src/sextante/grass/{description → }/grass.txt
@@ -1,7 +1,7 @@
A short guide for creating and editing GRASS algorithms for SEXTANTE:
-----------------------------------------------------------------------

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.
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.

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.

@@ -14,22 +14,25 @@ Each file starts with three lines containing:
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 "|"

-A raster layer
ParameterRaster|base|base|False

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

Example: ParameterRaster|base|base|False

-A vector layer

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

Example: ParameterRaster|points|points|False

To indicate the type of geometry, use the following values:

-1: any geometry
0: points
1: lines
2: polygons



-A numerical value

ParameterNumericalValue|[name of GRASS parameter]|[description of parameter to show]|[min value]|[max value]|[default value]
@@ -38,6 +41,38 @@ ParameterNumericalValue|[name of GRASS parameter]|[description of parameter to s

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

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

-A string

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

-A value to select from a list

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

-A boolean value

Example: ParameterBoolean|-c|-c|True

-Outputs

All outputs are added with the following syntax:

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

The following types are available

-OutputRaster
-OutputVector
-OutputTable
-OutputFile (for any file that is not a layer or table of a format supported by QGIS)


-Advanced parameters

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

*ParameterBoolean|-c|-c|True


0 comments on commit 3107d16

Please sign in to comment.