|
From: Logs S. c. messages. <gvs...@li...> - 2013-11-23 15:18:24
|
Revision: 1063
http://sourceforge.net/p/gvsigce/code/1063
Author: benducke
Date: 2013-11-23 15:18:20 +0000 (Sat, 23 Nov 2013)
Log Message:
-----------
Updates to manual pages.
Modified Paths:
--------------
trunk/sextante/docs/xml/en/general/IntroductionToSEXTANTE.css
trunk/sextante/docs/xml/en/general/batch.html
trunk/sextante/docs/xml/en/general/footnode.html
trunk/sextante/docs/xml/en/general/history.html
trunk/sextante/docs/xml/en/general/intro.html
trunk/sextante/docs/xml/en/general/modeler.html
trunk/sextante/docs/xml/en/general/toolbox.html
Added Paths:
-----------
trunk/sextante/docs/xml/en/general/IntroductionToSEXTANTE.html
trunk/sextante/docs/xml/en/general/WARNINGS
trunk/sextante/docs/xml/en/general/commandline.html
trunk/sextante/docs/xml/en/general/images.aux
trunk/sextante/docs/xml/en/general/images.idx
trunk/sextante/docs/xml/en/general/images.out
trunk/sextante/docs/xml/en/general/images.pl
trunk/sextante/docs/xml/en/general/images.tex
trunk/sextante/docs/xml/en/general/internals.pl
trunk/sextante/docs/xml/en/general/labels.pl
trunk/sextante/docs/xml/en/general/modeler_algorithm_pane_idw.png
trunk/sextante/docs/xml/en/general/modeler_algorithms_tab.png
trunk/sextante/docs/xml/en/general/modeler_grass_type_conversion.png
trunk/sextante/docs/xml/en/general/modeler_main_window.png
trunk/sextante/docs/xml/en/general/modeler_numerical_input.png
trunk/sextante/docs/xml/en/general/modeler_resize_node.png
trunk/sextante/docs/xml/en/general/modeler_run_model.png
trunk/sextante/docs/xml/en/general/modeler_sample_inputs.png
trunk/sextante/docs/xml/en/general/modeler_toolbox_models.png
trunk/sextante/docs/xml/en/general/node1.html
trunk/sextante/docs/xml/en/general/node2.html
trunk/sextante/docs/xml/en/general/node9.html
Removed Paths:
-------------
trunk/sextante/docs/xml/en/general/cmd.html
trunk/sextante/docs/xml/en/general/graphical_modeler.png
trunk/sextante/docs/xml/en/general/models_icon.png
trunk/sextante/docs/xml/en/general/models_parameters.png
trunk/sextante/docs/xml/en/general/models_parameters2.png
trunk/sextante/docs/xml/en/general/models_parameters3.png
trunk/sextante/docs/xml/en/general/models_parameters4.png
trunk/sextante/docs/xml/en/general/models_parameters5.png
trunk/sextante/docs/xml/en/general/models_parameters6.png
trunk/sextante/docs/xml/en/general/slope.png
Modified: trunk/sextante/docs/xml/en/general/IntroductionToSEXTANTE.css
===================================================================
--- trunk/sextante/docs/xml/en/general/IntroductionToSEXTANTE.css 2013-11-23 15:18:15 UTC (rev 1062)
+++ trunk/sextante/docs/xml/en/general/IntroductionToSEXTANTE.css 2013-11-23 15:18:20 UTC (rev 1063)
@@ -28,10 +28,10 @@
/* document-specific styles come next */
+DIV.navigation { }
+DIV.center { }
PRE.preform { }
-DIV.center { }
-DIV.navigation { }
+SPAN.textit { font-style: italic }
+SPAN.arabic { }
SPAN.textbf { font-weight: bold }
SPAN.textsf { font-style: italic }
-SPAN.arabic { }
-SPAN.textit { font-style: italic }
Added: trunk/sextante/docs/xml/en/general/IntroductionToSEXTANTE.html
===================================================================
--- trunk/sextante/docs/xml/en/general/IntroductionToSEXTANTE.html (rev 0)
+++ trunk/sextante/docs/xml/en/general/IntroductionToSEXTANTE.html 2013-11-23 15:18:20 UTC (rev 1063)
@@ -0,0 +1,293 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<!--Converted with LaTeX2HTML 2008 (1.71)
+original version by: Nikos Drakos, CBLU, University of Leeds
+* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
+* with significant contributions from:
+ Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
+<HTML>
+<HEAD>
+<TITLE>SEXTANTE User's manual (v1.0) </TITLE>
+<META NAME="description" CONTENT="SEXTANTE User's manual (v1.0) ">
+<META NAME="keywords" CONTENT="IntroductionToSEXTANTE">
+<META NAME="resource-type" CONTENT="document">
+<META NAME="distribution" CONTENT="global">
+
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
+<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
+
+<LINK REL="STYLESHEET" HREF="IntroductionToSEXTANTE.css">
+
+</HEAD>
+
+<BODY >
+
+<P>
+
+<P>
+
+<H1 ALIGN=CENTER>
+<BIG CLASS="XXLARGE"><B>SEXTANTE User's manual (v1.0)</B></BIG>
+<BR>
+<BR>
+
+</H1>
+<P ALIGN=CENTER><STRONG>Víctor Olaya</STRONG>
+<BR><I>
+Edition 1.0 -- Rev. March 26, 2013
+</I>
+</P>
+<HR>
+
+<P>
+
+<P>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<SMALL CLASS="SMALL">
+
+SEXTANTE User's manual
+<BR>
+Copyright ©2012 Victor Olaya
+<BR></SMALL>
+<P>
+<SMALL CLASS="SMALL">
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+Edición 1.0
+<BR>
+Rev. March 26, 2013
+<BR></SMALL>
+<P>
+<SMALL CLASS="SMALL">
+<BR>
+<BR>
+Permision is granted to copy, distribute and modify this work according to the terms of the Creative Common Attritution license under which it is distributed. More information can be found at <TT><A NAME="tex2html1"
+ HREF="http://www.creativecommons.org">http://www.creativecommons.org</A></TT>. License applies to the text, as well as to the images created by the author, which are all the ones contained in this text except when otherwise stated.
+</SMALL>
+<P>
+<SMALL CLASS="SMALL">This text can be downloaded in several formats, including editable ones, at <TT><A NAME="tex2html2"
+ HREF="http://www.sextantegis.com">http://www.sextantegis.com</A></TT>.
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+<BR>
+
+</SMALL>
+<P>
+
+
+<P>
+<BR><HR>
+<!--Table of Child-Links-->
+<A NAME="CHILD_LINKS"></A>
+
+<UL CLASS="ChildLinks">
+<LI><A NAME="tex2html13"
+ HREF="node1.html">Contents</A>
+<LI><A NAME="tex2html14"
+ HREF="node2.html">Index</A>
+<LI><A NAME="tex2html15"
+ HREF="node3.html">Introduction</A>
+<UL>
+<LI><A NAME="tex2html16"
+ HREF="node3.html#SECTION00310000000000000000">Introduction</A>
+<LI><A NAME="tex2html17"
+ HREF="node3.html#SECTION00320000000000000000">Basic elements of the SEXTANTE GUI</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html18"
+ HREF="node4.html">The SEXTANTE toolbox</A>
+<UL>
+<LI><A NAME="tex2html19"
+ HREF="node4.html#SECTION00410000000000000000">Introduction</A>
+<LI><A NAME="tex2html20"
+ HREF="node4.html#SECTION00420000000000000000">The algorithm dialog</A>
+<UL>
+<LI><A NAME="tex2html21"
+ HREF="node4.html#SECTION00421000000000000000">The parameters tab</A>
+<LI><A NAME="tex2html22"
+ HREF="node4.html#SECTION00422000000000000000">The analysis region tab</A>
+</UL>
+<LI><A NAME="tex2html23"
+ HREF="node4.html#SECTION00430000000000000000">Data objects generated by SEXTANTE algorithms</A>
+<LI><A NAME="tex2html24"
+ HREF="node4.html#SECTION00440000000000000000">Context help</A>
+<LI><A NAME="tex2html25"
+ HREF="node4.html#SECTION00450000000000000000">Configuring SEXTANTE</A>
+<UL>
+<LI><A NAME="tex2html26"
+ HREF="node4.html#SECTION00451000000000000000">General</A>
+<LI><A NAME="tex2html27"
+ HREF="node4.html#SECTION00452000000000000000">Folders</A>
+<LI><A NAME="tex2html28"
+ HREF="node4.html#SECTION00453000000000000000">Model</A>
+<LI><A NAME="tex2html29"
+ HREF="node4.html#SECTION00454000000000000000">GRASS, SAGA and other additional algorithm providers</A>
+</UL>
+<LI><A NAME="tex2html30"
+ HREF="node4.html#SECTION00460000000000000000">Iterative execution of algorithms</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html31"
+ HREF="node5.html">The SEXTANTE Modeler</A>
+<UL>
+<LI><A NAME="tex2html32"
+ HREF="node5.html#SECTION00510000000000000000">Introduction</A>
+<LI><A NAME="tex2html33"
+ HREF="node5.html#SECTION00520000000000000000">Definition of inputs</A>
+<LI><A NAME="tex2html34"
+ HREF="node5.html#SECTION00530000000000000000">Definition of the workflow</A>
+<LI><A NAME="tex2html35"
+ HREF="node5.html#SECTION00540000000000000000">Editing a model and its nodes</A>
+<LI><A NAME="tex2html36"
+ HREF="node5.html#SECTION00550000000000000000">File operations (loading and saving models)</A>
+<LI><A NAME="tex2html37"
+ HREF="node5.html#SECTION00560000000000000000">Running and documenting models</A>
+<LI><A NAME="tex2html38"
+ HREF="node5.html#SECTION00570000000000000000">Notes on GRASS-provided algorithms</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html39"
+ HREF="node6.html">The SEXTANTE batch processing interface</A>
+<UL>
+<LI><A NAME="tex2html40"
+ HREF="node6.html#SECTION00610000000000000000">Introducci\xF3n</A>
+<LI><A NAME="tex2html41"
+ HREF="node6.html#SECTION00620000000000000000">The parameters table</A>
+<LI><A NAME="tex2html42"
+ HREF="node6.html#SECTION00630000000000000000">Filling the parameters table</A>
+<LI><A NAME="tex2html43"
+ HREF="node6.html#SECTION00640000000000000000">Setting the output region</A>
+<LI><A NAME="tex2html44"
+ HREF="node6.html#SECTION00650000000000000000">Executing the batch process</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html45"
+ HREF="node7.html">The SEXTANTE command-line interface</A>
+<UL>
+<LI><A NAME="tex2html46"
+ HREF="node7.html#SECTION00710000000000000000">Introduction</A>
+<LI><A NAME="tex2html47"
+ HREF="node7.html#SECTION00720000000000000000">The interface</A>
+<UL>
+<LI><A NAME="tex2html48"
+ HREF="node7.html#SECTION00721000000000000000">Getting information about data</A>
+</UL>
+<LI><A NAME="tex2html49"
+ HREF="node7.html#SECTION00730000000000000000">Getting information about algorithms</A>
+<LI><A NAME="tex2html50"
+ HREF="node7.html#SECTION00740000000000000000">Running an algorithm</A>
+<LI><A NAME="tex2html51"
+ HREF="node7.html#SECTION00750000000000000000">Adjusting the analysis region</A>
+<LI><A NAME="tex2html52"
+ HREF="node7.html#SECTION00760000000000000000">Managing layers from the command-line interface</A>
+<LI><A NAME="tex2html53"
+ HREF="node7.html#SECTION00770000000000000000">Creating scripts and running them from the toolbox</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html54"
+ HREF="node8.html">The SEXTANTE history manager</A>
+<UL>
+<LI><A NAME="tex2html55"
+ HREF="node8.html#SECTION00810000000000000000">Introduction</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html56"
+ HREF="node9.html">Configuring algorithm providers</A>
+<UL>
+<LI><A NAME="tex2html57"
+ HREF="node9.html#SECTION00910000000000000000">Introduction</A>
+<LI><A NAME="tex2html58"
+ HREF="node9.html#SECTION00920000000000000000">SAGA</A>
+<LI><A NAME="tex2html59"
+ HREF="node9.html#SECTION00930000000000000000">GRASS</A>
+<UL>
+<LI><A NAME="tex2html60"
+ HREF="node9.html#SECTION00931000000000000000">R</A>
+</UL>
+<LI><A NAME="tex2html61"
+ HREF="node9.html#SECTION00940000000000000000">Some important notes</A>
+<LI><A NAME="tex2html62"
+ HREF="node9.html#SECTION00950000000000000000">More about the GRASS interface</A>
+<UL>
+<LI><A NAME="tex2html63"
+ HREF="node9.html#SECTION00951000000000000000">Usage notes and limitations</A>
+<UL>
+<LI><A NAME="tex2html64"
+ HREF="node9.html#SECTION00951100000000000000">Message output from GRASS modules</A>
+<LI><A NAME="tex2html65"
+ HREF="node9.html#SECTION00951200000000000000">Graphical interface</A>
+<LI><A NAME="tex2html66"
+ HREF="node9.html#SECTION00951300000000000000">Vector data exchange</A>
+<LI><A NAME="tex2html67"
+ HREF="node9.html#SECTION00951400000000000000">Raster data exchange</A>
+<LI><A NAME="tex2html68"
+ HREF="node9.html#SECTION00951500000000000000">Topology</A>
+<LI><A NAME="tex2html69"
+ HREF="node9.html#SECTION00951600000000000000">The GRASS region</A>
+</UL>
+<LI><A NAME="tex2html70"
+ HREF="node9.html#SECTION00952000000000000000">Windows notes</A>
+<LI><A NAME="tex2html71"
+ HREF="node9.html#SECTION00953000000000000000">Notes on specific modules</A>
+<UL>
+<LI><A NAME="tex2html72"
+ HREF="node9.html#SECTION00953100000000000000">r.colors(.stddev)</A>
+<LI><A NAME="tex2html73"
+ HREF="node9.html#SECTION00953200000000000000">r.in/out.gdal</A>
+<LI><A NAME="tex2html74"
+ HREF="node9.html#SECTION00953300000000000000">r.mapcalculator</A>
+<LI><A NAME="tex2html75"
+ HREF="node9.html#SECTION00953400000000000000">r.null</A>
+<LI><A NAME="tex2html76"
+ HREF="node9.html#SECTION00953500000000000000">v.in/out.ogr</A>
+<LI><A NAME="tex2html77"
+ HREF="node9.html#SECTION00953600000000000000">v.surf.bspline</A>
+<LI><A NAME="tex2html78"
+ HREF="node9.html#SECTION00953700000000000000">v.surf.idw</A>
+<LI><A NAME="tex2html79"
+ HREF="node9.html#SECTION00953800000000000000">v.to.3d</A>
+</UL>
+<LI><A NAME="tex2html80"
+ HREF="node9.html#SECTION00954000000000000000">Technical details</A>
+</UL>
+<LI><A NAME="tex2html81"
+ HREF="node9.html#SECTION00960000000000000000">Creating R scripts</A>
+</UL></UL>
+<!--End of Table of Child-Links-->
+<BR><HR>
+<ADDRESS>
+Anon
+2013-03-26
+</ADDRESS>
+</BODY>
+</HTML>
Added: trunk/sextante/docs/xml/en/general/WARNINGS
===================================================================
--- trunk/sextante/docs/xml/en/general/WARNINGS (rev 0)
+++ trunk/sextante/docs/xml/en/general/WARNINGS 2013-11-23 15:18:20 UTC (rev 1063)
@@ -0,0 +1,25 @@
+No implementation found for style `graphicx'
+No implementation found for style `hyperref'
+
+redefining command \v
+
+? brace missing for \
+
+Substitution of arg to newlabelxx delayed.
+
+redefining command \
+
+? brace missing for \oldcontentsline
+
+? brace missing for \oldnewlabel
+couldn't convert character inodot into available encodings
+
+\end{frontmatter} not found (ignored).
+
+\end{mainmatter} not found (ignored).
+
+Failed to convert image /tmp/l2h20918/image001.ps
+
+Failed to convert image /tmp/l2h20918/image003.ps
+
+Failed to convert image /tmp/l2h20918/image002.ps
Modified: trunk/sextante/docs/xml/en/general/batch.html
===================================================================
--- trunk/sextante/docs/xml/en/general/batch.html 2013-11-23 15:18:15 UTC (rev 1062)
+++ trunk/sextante/docs/xml/en/general/batch.html 2013-11-23 15:18:20 UTC (rev 1063)
@@ -7,8 +7,8 @@
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
-<TITLE>The SEXTANTE batch processing interface</TITLE>
-<META NAME="description" CONTENT="The SEXTANTE batch processing interface">
+<TITLE>The SEXTANTE command-line interface</TITLE>
+<META NAME="description" CONTENT="The SEXTANTE command-line interface">
<META NAME="keywords" CONTENT="IntroductionToSEXTANTE">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
@@ -26,191 +26,465 @@
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL CLASS="ChildLinks">
-<LI><A NAME="tex2html231"
- HREF="node6.html#SECTION00610000000000000000">Introducci\xF3n</A>
-<LI><A NAME="tex2html232"
- HREF="node6.html#SECTION00620000000000000000">The parameters table</A>
-<LI><A NAME="tex2html233"
- HREF="node6.html#SECTION00630000000000000000">Filling the parameters table</A>
-<LI><A NAME="tex2html234"
- HREF="node6.html#SECTION00640000000000000000">Setting the output region</A>
-<LI><A NAME="tex2html235"
- HREF="node6.html#SECTION00650000000000000000">Executing the batch process</A>
+<LI><A NAME="tex2html256"
+ HREF="node7.html#SECTION00710000000000000000">Introduction</A>
+<LI><A NAME="tex2html257"
+ HREF="node7.html#SECTION00720000000000000000">The interface</A>
+<UL>
+<LI><A NAME="tex2html258"
+ HREF="node7.html#SECTION00721000000000000000">Getting information about data</A>
</UL>
+<BR>
+<LI><A NAME="tex2html259"
+ HREF="node7.html#SECTION00730000000000000000">Getting information about algorithms</A>
+<LI><A NAME="tex2html260"
+ HREF="node7.html#SECTION00740000000000000000">Running an algorithm</A>
+<LI><A NAME="tex2html261"
+ HREF="node7.html#SECTION00750000000000000000">Adjusting the analysis region</A>
+<LI><A NAME="tex2html262"
+ HREF="node7.html#SECTION00760000000000000000">Managing layers from the command-line interface</A>
+<LI><A NAME="tex2html263"
+ HREF="node7.html#SECTION00770000000000000000">Creating scripts and running them from the toolbox</A>
+</UL>
<!--End of Table of Child-Links-->
<HR>
-<H1><A NAME="SECTION00600000000000000000">
-The SEXTANTE batch processing interface</A>
+<H1><A NAME="SECTION00700000000000000000">
+The SEXTANTE command-line interface</A>
+</H1>
+
+<H1><A NAME="SECTION00710000000000000000">
+Introduction</A>
</H1>
<P>
+The command-line interface allows advanced users to increase their productivity and performe complex operations that cannot be performed using any of the other elements of the SEXTANTE GUI. Models involving several algorithms can be defined using the command-line interface, and additional operations such as loops and conditional sentences can be added to create more flexible and powerful workflows.
-<H1><A NAME="SECTION00610000000000000000">
-Introducción</A>
+<P>
+
+<H1><A NAME="SECTION00720000000000000000">
+The interface</A>
</H1>
<P>
-SEXTANTE algorithms (including models) can be executed as a batch process. That is, they can be executed using not a single set of inputs, but several of them, executing the algorithm as many times as needed. This is useful when processing large amounts of data, since it is not necessary to launch the algorithm many times from the toolbox.
+Invoking the command-line interface will cause the following dialog to appear.
<P>
<DIV ALIGN="CENTER">
<IMG
- WIDTH="355" HEIGHT="449" ALIGN="BOTTOM" BORDER="0"
- SRC="./batch_processing.png"
- ALT="Image batch_processing">
+ WIDTH="397" HEIGHT="297" ALIGN="BOTTOM" BORDER="0"
+ SRC="./command_line.png"
+ ALT="Image command_line">
</DIV>
<P>
+The SEXTANTE command-line interface is based on BeanShell. BeanShell is a Java source interpreter with object scripting language features, that meaning that it dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures like those in Perl and JavaScript.
-<H1><A NAME="SECTION00620000000000000000">
-The parameters table</A>
+<P>
+A detailed description of BeanShell and its usage can be found at the BeanShell website<A NAME="tex2html3"
+ HREF="footnode.html#foot806"><SUP><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A>. Refer to it if you want to learn more about generic BeanShell features. This chapter covers only those particular elements which are related to SEXTANTE geoalgorithms.
+
+<P>
+By using the extension mechanisms of BeanShell, SEXTANTE adds several new commands to it, so you can run geoalgorithms or get information about the geospatial data you are using, among other things.
+
+<P>
+Java users can create small scripts and programs combining standard elements of Java with SEXTANTE commands. However, those who are not familiar with Java can also use the command-line interface to execute single processes or small sets of them, simply calling the corresponding methods.
+
+<P>
+A detailed description of all SEXTANTE commands is given next.
+
+<P>
+
+<H2><A NAME="SECTION00721000000000000000">
+Getting information about data</A>
+</H2>
+
+<P>
+Algorithms need data to run. Layers and tables are identified using the name they have in the table of contents of the GIS (and which usually can be modified using GIS tool). To call a geoalgorithm you have to pass it an identifier which represents the data to use for an input.
+
+<P>
+The <TT>data()</TT> command prints a list of all data objects available to be used, along with the particular name of each one (i.e. the one you have to use to refer to it). Calling it you will get something like this:
+
+<P>
+<PRE>
+RASTER LAYERS
+-----------------
+mdt25.asc
+
+VECTOR LAYERS
+-----------------
+Contour lines
+
+TABLES
+-----------------
+</PRE>
+
+<P>
+Be aware that some GIS allow you two have several layers with the same name. SEXTANTE will just take the first one which matches the specified identifier, so you should make sure you rename your data object so each one of them has a unique name.
+
+<P>
+To get more information about a particular data object, use the <TT>describe(name_of_data_object)</TT> command. Here are a few examples of the result you will get when using it to get more information about a vector layer, a raster layer and a table.
+
+<P>
+<PRE>
+>describe("points")
+Type: Vector layer - Point
+Number of entities: 300
+Table fields: | ID | X | Y | SAND | SILT | CLAY | SOILTYPE | EXTRAPOLAT |
+
+>describe("dem25")
+Type: Raster layer
+X min: 262846.525725
+X max: 277871.525725
+Y min: 4454025.0
+Y max: 4464275.0
+Cellsize X: 25.0
+Cellsize Y: 0.0
+Rows: 410
+Cols: 601
+
+>describe("spatialCorrelation")
+Type: TableNumber of records: 156
+Table fields: | Distance | I_Moran | c_Geary | Semivariance |
+</PRE>
+
+<P>
+
+<H1><A NAME="SECTION00730000000000000000">
+Getting information about algorithms</A>
</H1>
<P>
-Executing a batch process is similar to performing a single execution of an algorithm. Parameter values have to be defined, but in this case we need not just a single value for each parameter, but a set of them instead, one for each time the algorithm has to be executed. Values are introduced using a table like the one shown next.
+Once you know which data you have, it is time to know which algorithms are available and how to use them.
<P>
-<DIV ALIGN="CENTER">
-<IMG
- WIDTH="873" HEIGHT="375" ALIGN="BOTTOM" BORDER="0"
- SRC="./batch_processing2.png"
- ALT="Image batch_processing2">
+When you execute an algorithm using the toolbox, you use a parameters window with several fields, each one of them corresponding to a single parameter. When you use the command line interface, you must know which parameters are needed, so as to pass the right values to use to the method that runs that algorithm. Of course you do not have to memorize the requirements of all the algorithms, since SEXTANTE has a method to describe an algorithm in detail. But before we see that method, let's have a look at another one, the <TT>algs()</TT> method. It has no parameters, and it just prints a list of all the available algorithms. Here is a little part of that list as you will see it in your command-line shell.
-</DIV>
+<P>
+<PRE>
+bsh % algs();
+acccost-------------------------------: Accumulated cost(isotropic)
+acccostanisotropic--------------------: Accumulated cost (anisotropic)
+acccostcombined-----------------------: Accumulated cost (combined)
+accflow-------------------------------: Flow accumulation
+acv-----------------------------------: Anisotropic coefficient of variation
+addeventtheme-------------------------: Points layer from table
+aggregate-----------------------------: Aggregate
+aggregationindex----------------------: Aggregation index
+ahp-----------------------------------: Analytical Hierarchy Process (AHP)
+aspect--------------------------------: Aspect
+buffer--------------------------------: Buffer
+</PRE>
<P>
-Each line of this table represents a single execution of the algorithm, and each cell contains the value of one of the parameters. It is similar to the parameters tab that you see when executing an algorithm from the toolbox, but with a different arrangement.
+On the right you find the name of the algorithm in the current language, which is the same name that identifies the algorithm in the toolbox. However, this name is not constant, since it depends on the current language, and thus cannot be used to call the algorithm. Instead, a command-line is needed. On the left side of the list you will find the command-line name of each algorithm. This is the one you have to use to make a reference to the algorithm you want to use.
<P>
-By default, the table contains just two rows. You can add or remove rows using the buttons on the right hand side of the window.
+Now, let's see how to get a list of the parameters that an algorithms require and the outputs that it will generate. To do it, you can use the <TT>describealg(name_of_the_algorithm)</TT> method. Use the command-line name of the algorithm, not the full descriptive name.
<P>
-Once the size of the table has been set, it has to be filled with the desired values
+For example, if we want to calculate a flow accumulation layer from a DEM, we will need to execute the corresponding module, which, according to the list shown using the <TT>algs()</TT> method, is identified as <TT>accflow</TT>. The following is a description of its inputs and outputs.
<P>
+<PRE>
+>describealg("accflow")
+Usage: accflow(DEM[Raster Layer]
+ WEIGHTS[Optional Raster Layer]
+ METHOD[Selection]
+ CONVERGENCE[Numerical Value]
+ FLOWACC [output raster layer])
+</PRE>
-<H1><A NAME="SECTION00630000000000000000">
-Filling the parameters table</A>
+<P>
+If an algorithm has a selection parameter, the value of that parameter should be entered using an integer value. To know the available options, you can use the <TT>options</TT> command, as shown in the following example:
+
+<P>
+<PRE>
+bsh % options("slope");
+ METHOD(Method)
+ * 0 : Maximum slope (Travis et al. 1975)
+ * 1 : Maximum triangle Slope (Tarboton 1997)
+ * 2 : Plane fitting (Costa-Cabral & Burgess 1996)
+ * 3 : Fit 2nd degree polynom (Bauer, Rohdenburg, Bork 1985)
+ * 4 : Fit 2nd degree polynom (Heerdegen & Beran 1982)
+ * 5 : Fit 2nd degree polynom (Zevenbergen & Thorne 1987)
+ * 6 : Fit 3rd degree polynom (Haralick 1983)
+ UNITS(Units)
+ * 0 : Radians
+ * 1 : Degrees
+ * 2 : Percentage
+</PRE>
+
+<P>
+In this case, the <TT>slope</TT> algorithm has two such parameters, the first one of them with 7 options, and the second one with 3. Notice that ordeing is zero-based.
+
+<P>
+
+<H1><A NAME="SECTION00740000000000000000">
+Running an algorithm</A>
</H1>
<P>
-Whatever the type of parameter it represents, every cell has a text string as its associated value. Double-clicking on a cell, this string can be edited, directly typing the desired value. For most of the parameters, however, it is more convenient to use the button on the right hand side of the cell. Clicking on it, a dialog is shown to select the value of the parameter. The content of this dialog depends on the kind of parameter, and it features elements that make it easier to introduce the desired value. For example, for a selection parameter the list of all possible values is shown and the value can be chosen from them.
+Now you know how to describe data and algorithms, so you have everything you need to run any algorithm. There is only one single command to execute algorithms: <TT>runalg</TT>. Its syntax is as follows:
<P>
-<DIV ALIGN="CENTER">
-<IMG
- WIDTH="311" HEIGHT="120" ALIGN="BOTTOM" BORDER="0"
- SRC="./batch_processing3.png"
- ALT="Image batch_processing3">
+<PRE>
+> runalg{name_of_the_algorithm, param1, param2, ..., paramN)
+</PRE>
-</DIV>
+<P>
+The list of parameters to add depends on the algorithm you want to run, and is exactly the list that the <TT>describealg</TT> method gives you, in the same order as shown.
<P>
-For all parameter cells, if the introduced value is correct, it will be shown in black. If the value is wrong (for instance, a numerical value out of the valid range or an option that does not exists for a selecion parameter), the text will be shown in red.
+Depending on the type of parameter, values are introduced differently. The next one is a quick review of how to introduce values for each type of input parameter
+<UL>
+<LI>Raster Layer, Vector Layer or Table. Simply introduce the name that identifies the data object to use. If the input is optional and you do not want to use any data object, write ``#''.
+</LI>
+<LI>Numerical value. Directly type the value to use or the name of a variable containing that value.
+</LI>
+<LI>Selection. Type the number that identifies the desired option, as shown by the <TT>options</TT> command
+</LI>
+<LI>String. Directly type the string to use or the name of a variable containing it.
+</LI>
+<LI>Boolean. Type whether ``true'' or ``false'' (including quotes)
+</LI>
+<LI>Multiple selection - data_type. Type the list of objects to use, separated by commas and enclosed between quotes.
+
<P>
-<DIV ALIGN="CENTER">
-<IMG
- WIDTH="561" HEIGHT="81" ALIGN="BOTTOM" BORDER="0"
- SRC="./batch_processing4.png"
- ALT="Image batch_processing4">
+For example, for the <TT>maxvaluegrid</TT> algorithm:
-</DIV>
+<P>
+<PRE>
+Usage: runalg("maxvaluegrid",
+ INPUT[Multiple Input - Raster Layer]
+ NODATA[Boolean],
+ RESULT[Output raster layer])
+</PRE>
<P>
-The most importante different between executing an algorithm from the toolbox and executing it as part of a batch process is that input data objects are taken directly from files, and not from the set of layers already opened in the GIS. For this reason, any algorithm can be executed as a batch process even if no data objects at all are opened and the algorithm cannot be called from the toolbox.
+The next line shows a valid usage example:
<P>
-Filenames for input data objects are introduced directly typing or, more conveniently, clicking on the button on the right hand of the cell, which shows a typical file chooser dialog. Multiple files can be selected at once. If the input parameter represents a single data object and several files are selected, each one of them will be put in a separate row, adding new ones if needed. If it represents a multiple input, all the selected files will be added to a single cell, separated by commas.
+<PRE>
+> runalg("maxvaluegrid", "lyr1, lyr2, lyr3", "false", "#")
+</PRE>
<P>
-If multiple bands are required, a more complex dialog is shown, which incorporates a table for selecting both layer files and bands. Click on the cells on the left side to select the file which contains the raster layer. Then click on the left side to select the bands you want to use from that layer. To know the number of bands in a layer it would be necessary to open it. However, SEXTANTE does not open the layer, and shows instead a list of bands from 1 to 250 to select from. If you select a band that does not exist in the selected layer, an error message will be shown at execution time.
+Of course, lyr1, lyr2 and lyr3 must be valid layers already loaded into your GIS.
<P>
-<DIV ALIGN="CENTER">
-<IMG
- WIDTH="579" HEIGHT="455" ALIGN="BOTTOM" BORDER="0"
- SRC="./batch_processing_bands.png"
- ALT="Image batch_processing_bands">
+When the multiple input is comprised of raster bands, each element is represented by a pair of values <SPAN CLASS="textit">(layer, band)</SPAN>. For example, for the <TT>cluster</TT> algorithm
-</DIV>
+<P>
+<PRE>
+Usage: runalg( "cluster",
+ INPUT[Multiple Input - Band],
+ NUMCLASS[Numerical Value],
+ RESULTLAYER[output raster layer],
+ RESULTTABLE[output table],
+ );
+</PRE>
<P>
-Output data objects are always saved to a file and, unlike when executing an algorithm from the toolbox, saving to a temporary one is not permitted. You can type the name directly or use the file chooser dialog that appears when clicking on the accompanying button. This dialog differs slightly from the standard one, incorporating some additional fields for autocompletion.
+The next line shows a valid usage example:
<P>
-<DIV ALIGN="CENTER">
-<IMG
- WIDTH="963" HEIGHT="427" ALIGN="BOTTOM" BORDER="0"
- SRC="./batch_processing_save.png"
- ALT="Image batch_processing_save">
+<PRE>
+> runalg("cluster, "lyr1, 1, lyr1, 2, lyr2, 2", 5, "#", "#")
+</PRE>
-</DIV>
+<P>
+The algorithm will use three bands, two of them from lyr1 (the first and the second ones of that layer) and one from lyr2 (its second band).
+</LI>
+<LI>&lsqb#lbrack;Table Field from XXX &rsqb#rbrack;. Write the name of the field to use. This parameter is case-sensitive.
+</LI>
+<LI>&lsqb#lbrack;Fixed Table &rsqb#rbrack;Tabla fija. Type the list of all table values separated by commas and enclosed between quotes. Values start on the upper row and go from left to right. Here is an example:
<P>
-If the default value (<SPAN CLASS="textsf">Do not autocomplete</SPAN>) is selected, SEXTANTE will just put the selected filename in the selected cell from the parameters table. If any of the other options is selected, all the cells below the selected one will be automatically filled based on a defined criteria. This way, it is much easier to fill the table, and the batch process can be defined with less effort.
+<PRE>
+runalg("kernelfilter", "mdt25.asc", "-1, -1, -1, -1, 9, -1, -1, -1, -1", "#")
+</PRE>
<P>
-Automatic filling can be done simply adding correlative numbers to the selected filepath, or appending the value of another field at the same row. This is particularly useful for naming output data object according to input ones.
+</LI>
+<LI>&lsqb#lbrack;Point &rsqb#rbrack;. Write the pair of coordinates separated by commas and enclosed between quotes. For instance ``220345, 4453616''
<P>
-<DIV ALIGN="CENTER">
-<IMG
- WIDTH="368" HEIGHT="84" ALIGN="BOTTOM" BORDER="0"
- SRC="./batch_processing_filepath.png"
- ALT="Image batch_processing_filepath">
+</LI>
+</UL>
-</DIV>
+<P>
+Input parameters such as strings or numerical values have default values. To use them, type ``#'' in the corresponding parameter entry instead of a value expression.
<P>
-Cells can be selected just clicking and dragging. Selected cells can be copied and pasted in a different place of the parameters table, making it easy to fill it with repeated values.
+For output data objects, type the filepath to be used to save it, just as it is done from the toolbox. If you want to save the result to a temporary file, type ``#''. Use ``$'' to indicate that you want to overwrite an input layer. If the algorithm does not support overwriting, it will save the resulting layer to a temporary file. Use ``!'' to indicate that an output should not be created.
<P>
-<H1><A NAME="SECTION00640000000000000000">
-Setting the output region</A>
+<H1><A NAME="SECTION00750000000000000000">
+Adjusting the analysis region</A>
</H1>
<P>
-Just like when executing a single algorithm, when running a batch process you must define the extent of the region to be analyzed. The corresponding <SPAN CLASS="textit">Output region</SPAN> tab is similar to the one found when running a single algorithm, but only contains two options: <SPAN CLASS="textit">fit to input layers</SPAN> and <SPAN CLASS="textit">used-defined</SPAN>.
+If you execute from the command-line interface an algorithm that allows the user to select the characteristics of the analysis region, it will by default adjust it to the input layers, taking its extent (and cellsize in case of raster layers). You can toggle this behaviour using the <TT>autoextent</TT> command.
<P>
-The selection will be applied to all the single executions contained in the current batch process. If you want to use different output configurations, then you must define different batch processes.
+<PRE>
+> autoextent("true"/"false)
+</PRE>
<P>
-<DIV ALIGN="CENTER">
-<IMG
- WIDTH="596" HEIGHT="486" ALIGN="BOTTOM" BORDER="0"
- SRC="./batch_processing_output.png"
- ALT="Image batch_processing_output">
+If you want to define the analysis region manually or using a supporting layer, you have to use the <TT>extent</TT> command, which has three different variants.
-</DIV>
+<P>
+<PRE>
+Usage: extent(raster layer[string])
+ extent(vector layer[string], cellsize[double])
+ extent(x min[double], y min[double],
+ x max[double], y max[double],
+ cell size[double])
+Type "autoextent" to use automatic extent fitting when possible
+</PRE>
<P>
+When this command is used, the autoextent functionality is automatically deactivated.
-<H1><A NAME="SECTION00650000000000000000">
-Executing the batch process</A>
+<P>
+
+<H1><A NAME="SECTION00760000000000000000">
+Managing layers from the command-line interface</A>
</H1>
<P>
-To execute the batch process once you have introduced all the necessary values, just click on <SPAN CLASS="textit">OK</SPAN>. SEXTANTE will show the progress of each executed algorithm, and at the end will show a dialog with information about the values used and the problems encountered during the execution of the whole process.
+You can perform some operation with layers from the command-line interface, like the following ones:
<P>
-<DIV ALIGN="CENTER">
-<IMG
- WIDTH="508" HEIGHT="335" ALIGN="BOTTOM" BORDER="0"
- SRC="./batch_processing_executing.png"
- ALT="Image batch_processing_executing">
-</DIV>
+<UL>
+<LI>Opening a layer. Use the <TT>open(filepath_to_layer, name, view_name)</TT> command. <TT>View_name</TT> is the name of the view where the layer should be added, while <TT>name</TT> is the name to give to the layer in that view.
+</LI>
+<LI>Closing a layer. Use the <TT>close(layer_name)</TT> command.
+</LI>
+<LI>Changing the no-data value of a raster layer. Use the <TT>setnodata(layer_name, new_value)</TT> command
+</LI>
+<LI>Changing the name of a layer. Use the <TT>rename(layer_name, new_layer_name)</TT> command
+</LI>
+</UL>
<P>
-As it happened with the iterative execution of algorithms, when executing in a batch process an algorithm that produces text output with numerical values (such as, for instance, statistics of a raster layer), its numerical outputs are presented in a table in the results manager. Each row of the table represents an execution of the algorithm, while each column contains the values of one of the numerical variables being calculated.
+if you want to have the the names of layers and tables stored in a variable, so you can iterate them, you can use any of the following commands.
+
+<P>
+
+<UL>
+<LI><TT>getRasterLayers()</TT>.
+</LI>
+<LI><TT>getVectorLayers()</TT>.
+</LI>
+<LI><TT>getTables()</TT>.
+</LI>
+</UL>
+
+<P>
+All of these commands return an array of String values with the names of the corresponding data objects.
+
+<P>
+
+<H1><A NAME="SECTION00770000000000000000">
+Creating scripts and running them from the toolbox</A>
+</H1>
+
+<P>
+Scripts can be run using the <TT>source(script_filename)</TT> command. Simply put your commands in a text file and then you can execute them calling them with a single line.
+
+<P>
+You can define new commands (methods) and save them to a file, so running that file will load your commands and make them available for the current command-line session. For instance, here is an example method that calculates the slope of a DEM by all the available methods and then computes the mean value of all the slope layers and saves it to a temporary file.
+
+<P>
+<PRE>
+slopemean(dem, meanslope){
+ NUMBER_OF_METHODS = 7;
+ multiple = "";
+ for(i=0;i<NUMBER_OF_METHODS;i++){
+ runalg("slope", dem, "#", "#", "#");
+ rename("Slope", "Slope" + i);
+ multiple = multiple + "Slope" + i;
+ if (i < NUMBER_OF_METHODS - 1){
+ multiple=multiple + ",";
+ }
+ }
+ runalg("multigridmeanvalue", multiple, "#", meanslope);
+ for(i=0;i<NUMBER_OF_METHODS;i++){
+ close("Slope"+i);
+ }
+}
+</PRE>
+
+<P>
+Assuming that this script is saved in a file named <TT>/home/myuser/slopemean.bsh</TT>, then it could be run just entering
+
+<P>
+<PRE>
+source("/home/myuser/slopemean.bsh");
+</PRE>
+
+<P>
+After doing that, the <TT>slopemean</TT> command would be available and could be called with a line like the following one:
+
+<P>
+<PRE>
+slopemean("dem", "meanslope.tif");
+</PRE>
+
+<P>
+<TT>dem</TT> being the name of the DEM layer that we want to analyze. The file will be saved to the default output folder.
+
+<P>
+Scripts can be made available from the toolbox as geoalgorithms, following these rules:
+
+<P>
+
+<UL>
+<LI>Each script must contain just one method.
+</LI>
+<LI>The name of the method must be the same as the name of the script file.
+</LI>
+<LI>The file must have the ``bsh'' extension.
+</LI>
+</UL>
+
+<P>
+The above example meets these three requirements.
+
+<P>
+Since SEXTANTE needs some additional information to create the parameters window, additional lines must be added to provide that information. This should be added as Java comments before the method itself, and should have the name of the parameter(the name to show to the user), the equal sign (=) and the type of parameter. The following keywords can be used to describe the type of a given parameter: <TT>raster, vector, table, multiple raster, multiple vector, boolean, number, string, output raster, output vector, output table</TT>. Comments used to define parameters should appear in the same order as they appear in the method call.
+
+<P>
+For the above example, the following comment lines should be added:
+
+<P>
+<PRE>
+//dem=raster
+//meanslope=output raster
+</PRE>
+
+<P>
+The last step is to define the scripts folder. Only script files from that folder will be loaded as algorithms. You will find a <SPAN CLASS="textit">Script</SPAN> tab in the setting dialog, which is very similar to the <SPAN CLASS="textit">Models</SPAN> one that you should already know how to use.
+
+<P>
+Scripts in the scripts folder are automatically executed when the command line is opened, so their corresponding method will be available without having to call them using the <TT>source()</TT> command. Make sure that those files contain only method definitions; otherwise, the processes they contain will be executed as well each time you start a new command-line session (unless you really want that to happen...).
+
+<P>
+An easier way of creating scripts and adding them to the toolbox is to use the built-in script editor. In the toolbox, you will find a <SPAN CLASS="textit">Create new script</SPAN> command. It will open the editor, where you can start writing your script. The save button will allow you to save it. The default folder opened in the dialog when you click the save button is the scripts folder, so if you save your script there, it will be automatically included in the toolbox, with no need to go to the settings dialog as explained above.
+
+<P>
+The SEXTANTE help folder contains several example scripts. Check them to better understand how this feature works.
<BR><HR>
<ADDRESS>
-
+Anon
+2013-03-26
</ADDRESS>
</BODY>
</HTML>
Deleted: trunk/sextante/docs/xml/en/general/cmd.html
===================================================================
--- trunk/sextante/docs/xml/en/general/cmd.html 2013-11-23 15:18:15 UTC (rev 1062)
+++ trunk/sextante/docs/xml/en/general/cmd.html 2013-11-23 15:18:20 UTC (rev 1063)
@@ -1,489 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<!--Converted with LaTeX2HTML 2008 (1.71)
-original version by: Nikos Drakos, CBLU, University of Leeds
-* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
-* with significant contributions from:
- Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
-<HTML>
-<HEAD>
-<TITLE>The SEXTANTE command-line interface</TITLE>
-<META NAME="description" CONTENT="The SEXTANTE command-line interface">
-<META NAME="keywords" CONTENT="IntroductionToSEXTANTE">
-<META NAME="resource-type" CONTENT="document">
-<META NAME="distribution" CONTENT="global">
-
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
-<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
-
-<LINK REL="STYLESHEET" HREF="IntroductionToSEXTANTE.css">
-
-</HEAD>
-
-<BODY >
-<!--Table of Child-Links-->
-<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
-
-<UL CLASS="ChildLinks">
-<LI><A NAME="tex2html250"
- HREF="node7.html#SECTION00710000000000000000">Introduction</A>
-<LI><A NAME="tex2html251"
- HREF="node7.html#SECTION00720000000000000000">The interface</A>
-<UL>
-<LI><A NAME="tex2html252"
- HREF="node7.html#SECTION00721000000000000000">Getting information about data</A>
-</UL>
-<BR>
-<LI><A NAME="tex2html253"
- HREF="node7.html#SECTION00730000000000000000">Getting information about algorithms</A>
-<LI><A NAME="tex2html254"
- HREF="node7.html#SECTION00740000000000000000">Running an algorithm</A>
-<LI><A NAME="tex2html255"
- HREF="node7.html#SECTION00750000000000000000">Adjusting the analysis region</A>
-<LI><A NAME="tex2html256"
- HREF="node7.html#SECTION00760000000000000000">Managing layers from the command-line interface</A>
-<LI><A NAME="tex2html257"
- HREF="node7.html#SECTION00770000000000000000">Creating scripts and running them from the toolbox</A>
-</UL>
-<!--End of Table of Child-Links-->
-<HR>
-
-<H1><A NAME="SECTION00700000000000000000">
-The SEXTANTE command-line interface</A>
-</H1>
-
-<H1><A NAME="SECTION00710000000000000000">
-Introduction</A>
-</H1>
-
-<P>
-The command-line interface allows advanced users to increase their productivity and performe complex operations that cannot be performed using any of the other elements of the SEXTANTE GUI. Models involving several algorithms can be defined using the command-line interface, and additional operations such as loops and conditional sentences can be added to create more flexible and powerful workflows.
-
-<P>
-
-<H1><A NAME="SECTION00720000000000000000">
-The interface</A>
-</H1>
-
-<P>
-Invoking the command-line interface will cause the following dialog to appear.
-
-<P>
-<DIV ALIGN="CENTER">
-<IMG
- WIDTH="397" HEIGHT="297" ALIGN="BOTTOM" BORDER="0"
- SRC="./command_line.png"
- ALT="Image command_line">
-
-</DIV>
-
-<P>
-The SEXTANTE command-line interface is based on BeanShell. BeanShell is a Java source interpreter with object scripting language features, that meaning that it dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures like those in Perl and JavaScript.
-
-<P>
-A detailed description of BeanShell and its usage can be found at the BeanShell website<A NAME="tex2html3"
- HREF="footnode.html#foot768"><SUP><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A>. Refer to it if you want to learn more about generic BeanShell features. This chapter covers only those particular elements which are related to SEXTANTE geoalgorithms.
-
-<P>
-By using the extension mechanisms of BeanShell, SEXTANTE adds several new commands to it, so you can run geoalgorithms or get information about the geospatial data you are using, among other things.
-
-<P>
-Java users can create small scripts and programs combining standard elements of Java with SEXTANTE commands. However, those who are not familiar with Java can also use the command-line interface to execute single processes or small sets of them, simply calling the corresponding methods.
-
-<P>
-A detailed description of all SEXTANTE commands is given next.
-
-<P>
-
-<H2><A NAME="SECTION00721000000000000000">
-Getting information about data</A>
-</H2>
-
-<P>
-Algorithms need data to run. Layers and tables are identified using the name they have in the table of contents of the GIS (and which usually can be modified using GIS tool). To call a geoalgorithm you have to pass it an identifier which represents the data to use for an input.
-
-<P>
-The <TT>data()</TT> command prints a list of all data objects available to be used, along with the particular name of each one (i.e. the one you have to use to refer to it). Calling it you will get something like this:
-
-<P>
-<PRE>
-RASTER LAYERS
------------------
-mdt25.asc
-
-VECTOR LAYERS
------------------
-Contour lines
-
-TABLES
------------------
-</PRE>
-
-<P>
-Be aware that some GIS allow you two have several layers with the same name. SEXTANTE will just take the first one which matches the specified identifier, so you should make sure you rename your data object so each one of them has a unique name.
-
-<P>
-To get more information about a particular data object, use the <TT>describe(name_of_data_object)</TT> command. Here are a few examples of the result you will get when using it to get more information about a vector layer, a raster layer and a table.
-
-<P>
-<PRE>
->describe("points")
-Type: Vector layer - Point
-Number of entities: 300
-Table fields: | ID | X | Y | SAND | SILT | CLAY | SOILTYPE | EXTRAPOLAT |
-
->describe("dem25")
-Type: Raster layer
-X min: 262846.525725
-X max: 277871.525725
-Y min: 4454025.0
-Y max: 4464275.0
-Cellsize X: 25.0
-Cellsize Y: 0.0
-Rows: 410
-Cols: 601
-
->describe("spatialCorrelation")
-Type: TableNumber of records: 156
-Table fields: | Distance | I_Moran | c_Geary | Semivariance |
-</PRE>
-
-<P>
-
-<H1><A NAME="SECTION00730000000000000000">
-Getting information about algorithms</A>
-</H1>
-
-<P>
-Once you know which data you have, it is time to know which algorithms are available and how to use them.
-
-<P>
-When you execute an algorithm using the toolbox, you use a parameters window with several fields, each one of them corresponding to a single parameter. When you use the command line interface, you must know which parameters are needed, so as to pass the right values to use to the method that runs that algorithm. Of course you do not have to memorize the requirements of all the algorithms, since SEXTANTE has a method to describe an algorithm in detail. But before we see that method, let's have a look at another one, the <TT>algs()</TT> method. It has no parameters, and it just prints a list of all the available algorithms. Here is a little part of that list as you will see it in your command-line shell.
-
-<P>
-<PRE>
-bsh % algs();
-acccost-------------------------------: Accumulated cost(isotropic)
-acccostanisotropic--------------------: Accumulated cost (anisotropic)
-acccostcombined-----------------------: Accumulated cost (combined)
-accflow-------------------------------: Flow accumulation
-acv-----------------------------------: Anisotropic coefficient of variation
-addeventtheme-------------------------: Points layer from table
-aggregate-----------------------------: Aggregate
-aggregationindex----------------------: Aggregation index
-ahp-----------------------------------: Analytical Hierarchy Process (AHP)
-aspect--------------------------------: Aspect
-buffer--------------------------------: Buffer
-</PRE>
-
-<P>
-On the right you find the name of the algorithm in the current language, which is the same name that identifies the algorithm in the toolbox. However, this name is not constant, since it depends on the current language, and thus cannot be used to call the algorithm. Instead, a command-line is needed. On the left side of the list you will find the command-line name of each algorithm. This is the one you have to use to make a reference to the algorithm you want to use.
-
-<P>
-Now, let's see how to get a list of the parameters that an algorithms require and the outputs that it will generate. To do it, you can use the <TT>describealg(name_of_the_algorithm)</TT> method. Use the command-line name of the algorithm, not the full descriptive name.
-
-<P>
-For example, if we want to calculate a flow accumulation layer from a DEM, we will need to execute the corresponding module, which, according to the list shown using the <TT>algs()</TT> method, is identified as <TT>accflow</TT>. The following is a description of its inputs and outputs.
-
-<P>
-<PRE>
->describealg("accflow")
-Usage: accflow(DEM[Raster Layer]
- WEIGHTS[Optional Raster Layer]
- METHOD[Selection]
- CONVERGENCE[Numerical Value]
- FLOWACC [output raster layer])
-</PRE>
-
-<P>
-If an algorithm has a selection parameter, the value of that parameter should be entered using an integer value. To know the available options, you can use the <TT>options</TT> command, as shown in the following example:
-
-<P>
-<PRE>
-bsh % options("slope");
- METHOD(Method)
- * 0 : Maximum slope (Travis et al. 1975)
- * 1 : Maximum triangle Slope (Tarboton 1997)
- * 2 : Plane fitting (Costa-Cabral & Burgess 1996)
- * 3 : Fit 2nd degree polynom (Bauer, Rohdenburg, Bork 1985)
- * 4 : Fit 2nd degree polynom (Heerdegen & Beran 1982)
- * 5 : Fit 2nd degree polynom (Zevenbergen & Thorne 1987)
- * 6 : Fit 3rd degree polynom (Haralick 1983)
- UNITS(Units)
- * 0 : Radians
- * 1 : Degrees
- * 2 : Percentage
-</PRE>
-
-<P>
-In this case, the <TT>slope</TT> algorithm has two such parameters, the first one of them with 7 options, and the second one with 3. Notice that ordeing is zero-based.
-
-<P>
-
-<H1><A NAME="SECTION00740000000000000000">
-Running an algorithm</A>
-</H1>
-
-<P>
-Now you know how to describe data and algorithms, so you have everything you need to run any algorithm. There is only one single command to execute algorithms: <TT>runalg</TT>. Its syntax is as follows:
-
-<P>
-<PRE>
-> runalg{name_of_the_algorithm, param1, param2, ..., paramN)
-</PRE>
-
-<P>
-The list of parameters to add depends on the algorithm you want to run, and is exactly the list that the <TT>describealg</TT> method gives you, in the same order as shown.
-
-<P>
-Depending on the type of parameter, values are introduced differently. The next one is a quick review of how to introduce values for each type of input parameter
-
-<UL>
-<LI>Raster Layer, Vector Layer or Table. Simply introduce the name that identifies the data object to use. If the input is optional and you do not want to use any data object, write ``#''.
-</LI>
-<LI>Numerical value. Directly type the value to use or the name of a variable containing that value.
-</LI>
-<LI>Selection. Type the number that identifies the desired option, as shown by the <TT>options</TT> command
-</LI>
-<LI>String. Directly type the string to use or the name of a variable containing it.
-</LI>
-<LI>Boolean. Type whether ``true'' or ``false'' (including quotes)
-</LI>
-<LI>Multiple selection - data_type. Type the list of objects to use, separated by commas and enclosed between quotes.
-
-<P>
-For example, for the <TT>maxvaluegrid</TT> algorithm:
-
-<P>
-<PRE>
-Usage: runalg("maxvaluegrid",
- INPUT[Multiple Input - Raster Layer]
- NODATA[Boolean],
- RESULT[Output raster layer])
-</PRE>
-
-<P>
-The next line shows a valid usage example:
-
-<P>
-<PRE>
-> runalg("maxvaluegrid", "lyr1, lyr2, lyr3", "false", "#")
-</PRE>
-
-<P>
-Of course, lyr1, lyr2 and lyr3 must be valid layers already loaded into your GIS.
-
-<P>
-When the multiple input is comprised of raster bands, each element is represented by a pair of values <SPAN CLASS="textit">(layer, band)</SPAN>. For example, for the <TT>cluster</TT> algorithm
-
-<P>
-<PRE>
-Usage: runalg( "cluster",
- INPUT[Multiple Input - Band],
- NUMCLASS[Numerical Value],
- RESULTLAYER[output raster layer],
- RESULTTABLE[output table],
- );
-</PRE>
-
-<P>
-The next line shows a valid usage example:
-
-<P>
-<PRE>
-> runalg("cluster, "lyr1, 1, lyr1, 2, lyr2, 2", 5, "#", "#")
-</PRE>
-
-<P>
-The algorithm will use three bands, two of them from lyr1 (the first and the second ones of that layer) and one from lyr2 (its second band).
-</LI>
-<LI>&lsqb#lbrack;Table Field from XXX &rsqb#rbrack;. Write the name of the field to use. This parameter is case-sensitive.
-</LI>
-<LI>&lsqb#lbrack;Fixed Table &rsqb#rbrack;Tabla fija. Type the list of all table values separated by commas and enclosed between quotes. Values start on the upper row and go from left to right. Here is an example:
-
-<P>
-<PRE>
-runalg("kernelfilter", "mdt25.asc", "-1, -1, -1, -1, 9, -1, -1, -1, -1", "#")
-</PRE>
-
-<P>
-</LI>
-<LI>&lsqb#lbrack;Point &rsqb#rbrack;. Write the pair of coordinates separated by commas and enclosed between quotes. For instance ``220345, 4453616''
-
-<P>
-</LI>
-</UL>
-
-<P>
-Input parameters such as strings or numerical values have default values. To use them, type ``#'' in the corresponding parameter entry instead of a value expression.
-
-<P>
-For output data objects, type the filepath to be used to save it, just as it is done from the toolbox. If you want to save the result to a temporary file, type ``#''. Use ``$'' to indicate that you want to overwrite an input layer. If the algorithm does not support overwriting, it will save the resulting layer to a temporary file. Use ``!'' to indicate that an output should not be created.
-
-<P>
-
-<H1><A NAME="SECTION00750000000000000000">
-Adjusting the analysis region</A>
-</H1>
-
-<P>
-If you execute from the command-line interface an algorithm that allows the user to select the characteristics of the analysis region, it will by default adjust it to the input layers, taking its extent (and cellsize in case of raster layers). You can toggle this behaviour using the <TT>autoextent</TT> command.
-
-<P>
-<PRE>
-> autoextent("true"/"false)
-</PRE>
-
-<P>
-If you want to define the analysis region manually or using a supporting layer, you have to use the <TT>extent</TT> command, which has three different variants.
-
-<P>
-<PRE>
-Usage: extent(raster layer[string])
- extent(vector layer[string], cellsize[double])
- extent(x min[double], y min[double],
- x max[double], y max[double],
- cell size[double])
-Type "autoextent" to use automatic extent fitting when possible
-</PRE>
-
-<P>
-When this command is used, the autoextent functionality is automatically deactivated.
-
-<P>
-
-<H1><A NAME="SECTION00760000000000000000">
-Managing layers from the command-line interface</A>
-</H1>
-
-<P>
-You can perform some operation with layers from the command-line interface, like the following ones:
-
-<P>
-
-<UL>
-<LI>Opening a layer. Use the <TT>open(filepath_to_layer, name, view_name)</TT> command. <TT>View_name</TT> is the name of the view where the layer should be added, while <TT>name</TT> is the name to give to the layer in that view.
-</LI>
-<LI>Closing a layer. Use the <TT>close(layer_name)</TT> command.
-</LI>
-<LI>Changing the no-data value of a raster layer. Use the <TT>setnodata(layer_name, new_value)</TT> command
-</LI>
-<LI>Changing the name of a layer. Use the <TT>rename(layer_name, new_layer_name)</TT> command
-</LI>
-</UL>
-
-<P>
-if you want to have the the names of layers and tables stored in a variable, so you can iterate them, you can use any of the following commands.
-
-<P>
-
-<UL>
-<LI><TT>getRasterLayers()</TT>.
-</LI>
-<LI><TT>getVectorLayers()</TT>.
-</LI>
-<LI><TT>getTables()</TT>.
-</LI>
-</UL>
-
-<P>
-All of these commands return an array of String values with the names of the corresponding data objects.
-
-<P>
-
-<H1><A NAME="SECTION00770000000000000000">
-Creating scripts and running them from the toolbox</A>
-</H1>
-
-<P>
-Scripts can be run using the <TT>source(script_filename)</TT> command. Simply put your commands in a text file and then you can execute them calling them with a single line.
-
-<P>
-You can define new commands (methods) and save them to a file, so running that file will load your commands and make them available for the current command-line session. For instance, here is an example method that calculates the slope of a DEM by all the available methods and then computes the mean value of all the slope layers and saves it to a temporary file.
-
-<P>
-<PRE>
-slopemean(dem, meanslope){
- NUMBER_OF_METHODS = 7;
- multiple = "";
- for(i=0;i<NUMBER_OF_METHODS;i++){
- runalg("slope", dem, "#", "#", "#");
- rename("Slope", "Slope" + i);
- multiple = multiple + "Slope" + i;
- if (i < NUMBER_OF_METHODS - 1){
- multiple=multiple + ",";
- }
- }
- runalg("multigridmeanvalue", multiple, "#", meanslope);
- for(i=0;i<NUMBER_OF_METHODS;i++){
- close("Slope"+i);
- }
-}
-</PRE>
-
-<P>
-Assuming that this script is saved in a file named <TT>/home/myuser/slopemean.bsh</TT>, then it could be run just entering
-
-<P>
-<PRE>
-source("/home/myuser/slopemean.bsh");
-</PRE>
-
-<P>
-After doing that, the <TT>slopemean</TT> command would be available and could be called with a line like the following one:
-
-<P>
-<PRE>
-slopemean("dem", "meanslope.tif");
-</PRE>
-
-<P>
-<TT>dem</TT> being the name of the DEM layer that we want to analyze. The file will be saved to the default output folder.
-
-<P>
-Scripts can be made available from the toolbox as geoalgorithms, following these rules:
-
-<P>
-
-<UL>
-<LI>Each script must contain just one method.
-</LI>
-<LI>The name of the method must be the same as the name of the script file.
-</LI>
-<LI>The file must have the ``bsh'' extension.
-</LI>
-</UL>
-
...
[truncated message content] |