NavTable is a gvSIG extension to display in an agile way the alphanumeric elements of vectorial layers. It allows seeing the features of an element in a vertical table besides editing, navigating and quick filtering the values of a layer.
NavTable is released under a GPL v3 license. It has been created by CartoLab, the Cartographic Laboratory from University of A Coruña. Feel free to send us comments, suggestions, bug reports, etc.
NavTable was designed following a modular architecture, which allow to extend their functionalities in an easy way plus using it to display personalized forms.
Its center panel is easily adaptable by injecting other forms to display, edit and even process the data. See next figure to learn the possibilities of this approach:
Bear in mind that the code of NavTable is publicly available in the project website so that you can download and adapt it.
To activate NavTable you must select a vector layer in the gvSIG ToC (Table of Contents) and click the button NavTable .
NavTable interface has the following areas:
NavTable can be used for editing and display alpha-numeric tables, which have no associated geometry. For these cases, NavTable icon in the toolbar will be blue . The title of the NavTable window for tables without geometry has a '*' to distinguish it from normal tables.
NavTable scrolls through the records and features in a friendly way. You will find the navigation bar at the bottom of NavTable's window.
With these buttons you can:
If you are working in the central area of NavTable (click on any row) you can use the buttons “right”or “left”, “home” or “end” to change the record that you want to see.
If you click on the checkbox "selected" the navigation buttons will work only for features that are previous selected. If a feature is selected, the bottom area of the NavTable Window will be highlighted in yellow. In between parentheses the number of selected records can be seen next to the whole number of records.
In this image you see an example explaining how this function works: record 8 for a layer with 20 records is displayed where 7 records are selected.
If the checkbox "selected" is activated without any selected feature, all records will be shown empty and the box will not display any number. and .
The option "select" is another interesting tool you can find next to "selected" in the Nav Table menu. If you activate the checkbox next to "select", the attributes you are visualizing will be selected and highlighted in the view. In the case that other features were selected, this option will turn them unselected and will select only the register you are visualizing.
On top of the NavTable Window there is the button "Filter" . If you press it, a dialogue window will appear in which you can define exactly what you want to select (attributes and calculations). If you click on "clear selection" all selections will be turned off and no features will be selected.
If you click on the zoom button the feature will be displayed in the center of the view, referring to the record you are working with at that time. The scale of the view will be changed to have a good visualization of the data. In case you are working with a point layer, a scale size will be chosen that allows to see also the surroundings of the point.
With help of the button "always zoom" next to the checkbox "select", Navtable will zoom to each feature referring to the record you are visualizing. If you click on "fixed scale" as well, Navtable will zoom to the feature and display it in the center of the view, but the scale will always remain the same. It is possible to change the scale value introducing a new one in the "scale bar" of gvSIG. This is shown on the buttom right of the gvSIG view, next to where the coordinates are displayed.
Tip: The options "always zoom" or "fixed scale" together with "select" is a very interesting way of navigate through the features of a layer.
The main new functionality in Navtable is that you don't need to start the editing mode for a layer if you want to edit it. You should follow these steps to edit the table:
After that, the new value will be saved. It's important to consider these special cases if you want to save the edition:
With Navtable it is also possible to use options for advanced editing. For example you can copy and paste records. For that you should select the record you want to copy first and click then on the button "copy selected feature" . The data will be modified when you click on the button "save".
Removing records
It is possible to delete the record you are visualizing with Navtable if you click on the button "delete feature" . If this record has an associated geometry feature (graphical element), this one will be also deleted.
Adding records to alphanumerical tables
For tables which aren't associated to a layer, Navtable has this button . If you click on it, after the last one of the table a new record will appear.
As you know, the dbf format doesn't allow field names with more than 10 characters. This limitation could be solved using alias for these fields. This option is also available for layers stored in a geodatabase.
If you wish to use this functionality you will need to create a text file with the same name as the layer in which you want to use "alias" names. Save this text file in the folder "alias" that was created when installing Navtable.
When installing gvSIG, a folder with the name gvSIG will also be created:
On Windows it is usually installed here "C:Documents and Settingsuser"
On GNU/Linux you will find it here: "/home/user/gvSIG"
When installing Navtable, a folder with the Name "Navtable" is saved to the "gvSIG" folders. At the Navtable folder you will find the "Alias" one, where you should save the text file mentioned above.
In this file you can define long names or alias for the field names.
Name_original_field=long_name
It's only necessary to describe a row for the fields you want to define an alias name for. The order of the lines isn't important, that means, you don't need to follow the same sequence like the field's names of the table.
When Navtable is opened, the according "alias" text file will be found automatically. If new names for the fields are available there, Navtable will use these ones instead of the original names.
Example: There is a dbf file with the following fields:
We define an alias text file with the same name as the shape file: Afg_district.alias in this case. In this file we will write the following text:
prov_code=province code distr_code=district code
This file Afg_district.alias will be saved in the same folder as the file Afg_district.shp. Now we can open the table of this layer with Navtable and can see the following:
Important for Windows:
Windows doesn't show the file extension by default. For this reason for a new alias text file the name of the file will be probably name_layer.alias.txt and Navtable will not be able to read this alias file.
In order to have a correct result for this functionality we recommend you to deactivate the option hide hidden files and folders. You can make this in Windows Explorer: Extras > File Options > View > Advanced Settings > Hidden Files and Folders
NavTable is hosted by the OSOR Forge [1]. On this page you can find useful information about the project and also related documents, mailing lists, bug reporting system, etc.
In the section "Future Work" on the project website you will find some of the things we want to incorporate in NavTable in the near future.
[1] | http://navtable.forge.osor.eu/ |
Chart or diagram legends are intended to provide a visual representation of data in a table, thereby communicating a lot of information very easily.
In particular this extension allows two types of legends to be constructed:
The new pie chart legend extends the functionality of existing gvSIG legends, and can be found along with the rest of the legends in the Multiple Attributes section.
The pie legend is located in the Multiple attributes section of the legend tree, and can be used to represent several attributes at once. To access it, right-click on the layer name to open the Properties and then select the symbols tab.
The following options are available for configuring the pie charts:
Fields: You can choose which of the layer's fields to represent, provided they are numeric. With these fields you can:
To do this click on the buttons shown in the image above (Box 1).
Colour scheme: You can change the default colour scheme for the pies. To do this select the desired "Colour scheme" from the drop-down list, as shown in the image above (Box 2).
Change the colour: In addition it is possible to change the colour of pie slices once they have been added.
Once the default colour scheme has been chosen, the colour of a pie slice can be changed by double-clicking on its color.
The following dialog is displayed where you can select a colour sample or set it yourself (HSB, RGB).
Background symbol: You can change the symbol of the background geometries by clicking on the symbol to open the symbol editor (pictured above, Box 3).
Outline: You can display an outline with a specified colour and thickness around the pie slices. Tick the "Show" check box to draw outlines around the pie sectors.
Dimension: Tick the check box to display the pie in 3D. By default the pie is drawn in 2D.
Preview chart: Any changes made are reflected on the chart preview.
Click the 'Size' button located in the pie legend configuration screen.
Clicking this will open the following dialog:
There are three options for setting the size of the diagrams:
In addition to setting the size of the pie, the units can also be specified.
Units: Select units (meters, pixels ...) and representation (in the world or print layout), depending on your requirements. If the units are set to "in the world" then the size will depend on the View's zoom level, while selecting "print layout" results in a fixed size, both on the screen and when printed.
Active Limits: Limits can be specified if the size of the chosen field size is not set to the "Fixed Size" option.
Activating limits for the other options sets the minimum and maximum values of a particular measure (Sum of field values or Field size). Taking the limits into account, the intermediate field values are calculated in proportion to the values of the records of the field, or to the sum of the field values.
This option is used to restrict the drawing of pie charts to selected geometries.
The geometries can be selected either before or after configuring the pie chart size and display options.
In order to represent pie charts for selected geometries, simply activate the check box Draw only selection in the pie legend configuration dialog.
The following image shows an example in which pie charts are only shown for selected geometries (shown in yellow).
The bar chart legend extends the functionality of existing gvSIG legends and can be found, like the pie chart, in the Multiple Attributes section.
The bar legend is located the Multiple Attributes section of the legend tree, and can be used to represent several attributes at once. To access it, right-click on the layer name to open the Properties, then select the Symbols tab.
The following options are available for configuring bar charts:
Fields: You can choose which of the layer's fields to represent, provided they are numeric. With these fields you can:
To do this click on the buttons shown in the image above (Box 1).
Colour scheme: You can change the default colour scheme for the bars. To do this, select the desired "Colour scheme" from the drop-down list, as shown in the image above (Box 2).
Change the colour: In addition it is possible to change the colour of bars once they have been added.
Once the default colour scheme has been chosen, the colour of a bar can be changed by double-clicking on its color tile.
You can use the following dialog to select a colour sample, or set it yourself (HSB, RGB).
Background symbol: You can change the symbol of the background geometries by clicking on the symbol to open the symbol editor (pictured above, Box 3).
Outline: You can display an outline with a specified colour and thickness around the bars. Tick the "Show" check box to draw outlines around the bars.
Dimension: Tick the check box to display the bars in 3D. By default the bars are drawn in 2D.
Preview chart: Any changes made are reflected on the chart preview.
Click the 'Size' button located in the bar legend configuration screen.
Clicking this will open the following dialog:
There are three options for setting the size of the diagrams:
In addition to setting the size of the bars, the units can also be specified.
Units: Select units (meters, pixels ...) and representation (in the world or print layout), depending on your requirements. If the units are set to "in the world" then the size will depend on the View's zoom level, while selecting "print layout" results in a fixed size, both on the screen and when printed.
Active Limits: Limits can be specified if the size of the chosen field size is not set to the "Fixed Size" option.
Activating limits for the other options sets the minimum and maximum values of a particular measure (Sum of field values or Field size). Taking the limits into account, the intermediate field values are calculated in proportion to the values of the records of the field, or to the sum of the field values.
This option is used to restrict the drawing of bar charts to selected geometries.
The geometries can be selected either before or after configuring the bar chart size and display options.
In order to display bar charts for selected geometries, simply tick the check box “Draw only selection” in the pie legend configuration dialog.
The following image shows an example in which bar charts are only shown for selected geometries (shown in yellow).
This text is targeted at those using geospatial algorithms from the SEXTANTE library through the available GUI on this new version of gvSIG, the SEXTANTE toolbar. It is located at the right of the three main icons of the gvSIG toolbar.
Particular information about SEXTANTE algorithms is not found in this text. The user should refer to the context help system instead.
There are five basic elements in the SEXTANTE toolbar, which are used to run SEXTANTE algorithms for diferent purposes. Choosing one tool or another will depend on the kind of analysis that is to be performed and the particular characteristics of each user an project.
The SEXTANTE elements are available in a toolbar like the one show next.
Along the following chapters we will review each one of this elements in detail.
The Toolbox is the main element of the SEXTANTE GUI, and the one that you are more likely to use in your daily work. It shows the list of all available algorithms grouped in different blocks, and is the access point to run them whether as a single process or as a batch process involving several executions of a same algorithm on different sets of inputs.
Depending on the data available in the gvSIG View, you will be able to execute an algorithm or not. When there is enough data for the algorithm to be executed (i.e. the algorithm requires raster layers and you have raster layer already loaded into the View), its name is shown in black, otherwise, it is show in grey.
In the lower part of the toolbox you can find a text box and a search button. To reduce the number of algorithms shown in the toolbox and make it easier to find the one you need, you can enter any word or phrase on the text box and click on the search button. SEXTANTE will search the help files associated to each algorithm and show only those algorithms that include the word or phrase in their corresponding help files. To show all the algorithms again, make a search with an empty string.
To execute an algorithm, just double-click on its name in the toolbox.
Once you double-click on the name of the algorithm that you want to execute, a dialog similar to the next one is shown (in this case, the dialog corresponds to the Anisotropic cost algorithm).
This dialog is used to set the input values that the algorithm needs to be executed. There is a main tab named Parameters where input values and configuration parameters are set. This tab has a different content depending on the requirements of the algorithm to be executed, and is created automatically based on those requirements. On the left side, the name of the parameter is shown. On the right side the value of the parameter can be set.
Those algorithms that generate raster layers as output have an additional tab named Raster output. This tab is used to set the characteristics of those output raster layers, specifying its extent and its cell size. On the lower part of the window there is a help button. Click on it to see the context help related to the current algorithm, where you will find detailed description of each parameter and each output generated by the algorithm.
Although the number and type of parameters depends on the characteristics of the algorithm, the structure is similar for all of them. The parameters found on the parameters tab can be of one of the following types.
Click on the button on the right side to see the table and edit its values.
Depending on the algorithm, the number of rows can be modified or not, using the buttons on the right side of the window.
The Raster output tab is found in those algorithms that generate raster layers. Unlike in most GIS, when combining several raster layers as input for an algorithm, they do not have to have the same extent an cellsize in order to process them together. That is, layers don't have necessarily to match" between them. Instead, the characteristics of the output raster layer are defined and SEXTANTE performs the corresponding resampling and cropping needed to generate layer with those characteristics.
It is responsibility of the user to enter adequate values and be aware of the limitations of this mechanism, so as to generate cartographically correct results. (i.e. you can select a small cell size for the resulting raster layers, but if the input layers you are using have a bad resolution the results will not be geographically sound).
The following options are available in the raster output tab:
If an option other than the automatic fitting is selected, SEXTANTE will check that the values are correct and the resulting layers will not be too large (due to, for instance, a wrong cell size). If the output layers seems to large, SEXTANTE will show the next message dialog to ensure that the user really want those layer to be created.
Not all algorithms have the first option available, since not all algorithms that generate raster layers take some other raster layer as input. The interpolation algorithms, for instance, take a vector layer and create a raster one. The extent and cellsize of the latter has to be manually defined, since it cannot be set based solely on the input vector layer.
Data objects generated by SEXTANTE can be of any of the following types:
Layers and tables can be saved to a file, and the parameters window will contain a text box corresponding to each one of these outputs, where you can type the desired file path. If you do not enter any file path, a temporal file name and folder will be used.
The supported formats for the SEXTANTE cartographic output files are as follows.
To select a format, just select the corresponding file extension. If the extension of the file path you entered does not match any of the supported ones, the default extension (the first one in the list of supported ones) will be appended to the file path and the file format corresponding to that extension will be used to save the layer or table.
Graphics and texts are kept in memory and shown at the end of the algorithm execution in a new dialog. This dialog will keep the results produced by SEXTANTE during the current session, and can be shown at any time using the Results button. You can save graphical results as images in png format, and texts as HTML files. Rightclick on the name of the result in the tree on the left hand of the window and select Save as....
Each SEXTANTE algorithm has its own context help file, which provides detailed information about the meaning of each input parameter and each output object, and gives hints about its usage. To access the context help system, click on the button that you will find in the algorithm dialog, or rightclick on its name on the toolbox and then select See help.
The context help system contains not only information about each algorithm, but also description of each one of the elements of the SEXTANTE GUI like the text you are reading now. You will find it at the top of the tree on the left hand side of the help window. Just select an item to see its associated help file on the right canvas.
Help files associated to each algorithm are stored as XML files, and can be edited using the help authoring tools included with SEXTANTE. Right click on the name of the algorithm in the context help window and select Edit help to get to the following window:
On the left hand side you can select any of the elements to be documented (input parameter and outputs, along with other fixed field such as a general description of the algorithm). Then use the right hand side boxes to enter to text associated to that element or add images.
The graphical modeler allows to create complex models using a simple and easytouse interface. When working with a GIS, most analysis operations are not isolated, but part of a chain of operations instead. Using the graphical modeler, that chain of processes can be wrapped into a single process, so it is easier and more convenient to execute than single process later on a different set on inputs. No matter how many steps and different algorithms it involves, a model is executed as a single algorithm, thus saving time and effort, specially for larger models.
The modeler has a working canvas where the structure of the model and the workflow it represents are shown. On the left part of the window, a panel with two tabs can be used to add new elements to the model.
Creating a model is a two-step process.
The first step to create a model is to define the inputs it needs. The following elements are found in the Inputs tabs on the left side of the modeler window:
Double-clicking on any of them, a dialog is shown to define its characteristics. Depending on the parameter itself, the dialog will contain just one basic element (the description, which is what the user will see when executing the model) or more of them. For instance, when adding a numerical value, as can be seen in the next figure, apart from the description of the parameter is needed to set a default value, the type of numerical value and a range of valid values.
For each added input, a new element is added to the modeler canvas.
Once the inputs have been defined, it is time to define the algorithms to apply on them. Algorithms can be found in the Processes tab, grouped much in the same way as they are in the toolbox.
To add a process, double-click on its name. An execution dialog will appear, with a content similar to the one found execution panel that SEXTANTE shows when executing the algorithm from the toolbox.
Some differences exist, however, the main one being the absence of a raster ouput tab, even if the selected algorithm generates raster layers as output.
Instead of the textbox that was used to set the filepath for output layers and tables, a checkbox and a text box are found. If the layer generated by the algorithm is just a temporary result that will be used as the input of another algorithm and should not be kept as a final result, the check box should be left unchecked. Checking it means that the result is a final one, and you have to supply also a valid description for the output, which will be the one the user will see when executing the model.
Selecting the value of each parameter is also a bit different, since there are important differences between the context of the modeler and the toolbox one. Let's see how to introduce the values for each type of parameter.
Once all the parameter have been assigned valid values, click on OK and the algorithm will be added to the canvas. It will be linked to all the other elements in the canvas, whether algorithms or inputs, which provide objects that are used as inputs for that algorithm.
Once the model has been designed, it can be executed clicking on the Run button. The execution window will have a parameters tab automatically created based on the requirements of the model (the inputs added to it), just like it happens when a simple algorithm is executed. If any of the algorithms of the model generates raster layers, the Raster output tab will be added to the window.
Elements can be dragged to a different position within the canvas, to change the way the module structure is displayed and make it more clear and intuitive. Links between elements are update automatically.
To change the parameters of any of the algorithms of a model, doubleclick on it to access its parameters window.
To delete an element, right-click on it and select Delete. Only those elements that do not have any other one depending on them can be deleted. If you try to delete an element that cannot be deleted, SEXTANTE will show a warning message.
Models can be saved to be executed or edited at a later time. Use the Save button to save the current model and the Open model to open any model previously saved. Model are saved in an XML file with the .model extension.
Models saved on the models folder will appear in the toolbox algorithm tree in a group named Models.
When the toolbox is invoked, SEXTANTE searches the models folder for files with .model extension and loads the models they contain. Since a model is itself a SEXTANTE algorithm, it can be added to the toolbox just like any other algorithm.
The models folder can be set from the SEXTANTE toolbox, clicking the configuration button at the right lower corner of the window, and then introducing the path to the folder in the corresponding field.
Models loaded from the models folder appear not only in the toolbox, but also in the algorithms tree in the Processes tab of the modeler window. That means that you can incorporate a model as a part of a bigger model, just as you add any other algorithm.
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.
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.
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.
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.
Once the size of the table has been set, it has to be filled with the desired values.
Whatever the type of parameter it represents, every cell has a text string as its associated value. Doubleclicking 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.
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 selection parameter), the text will be shown in red.
The most important 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.
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.
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.
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.
If the default value (Do not autofill) 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 lled based on a defined criteria. This way, it is much easier to ll the table, and the batch process can be defined with less effort.
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. 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 ll it with repeated values.
Just like when executing a single algorithm, when running a batch process that generates raster layers you must define the extent and cellsize of the raster layers to be created. The corresponding Raster Output tab is similar to the one found when running a single algorithm, but only contains two options: t to input layers and user-defined.
The selection will be applied to all the single executions contained in the current batch process. If you want to use different raster output configurations, then you must define different batch processes.
To execute the batch process once you have introduced all the necessary values, just click on OK. 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.
It is possible to execute the batch processing from a set of layers from the current view, clicking on the correct option in the toolbox tree, similar as it was the usual batch processing.
The command-line interface allows advanced users to increase their productivity and perform 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.
Invoking the command-line interface will make the following dialog appear.
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.
A detailed description of BeanShell and its usage can be found at the BeanShell website. 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.
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.
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.
A detailed description of all SEXTANTE commands is given next.
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 modied using GIS tool). To call a geoalgorithm you have to pass it an identifier which represents the data to use for an input.
The data() 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:
RASTER LAYERS ----------------- mdt25.asc VECTOR LAYERS ----------------- Curvas de nivel TABLES -----------------
Be aware that gvSIG allows you to 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.
To get more information about a particular data object, use the describe(name of data object) 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.
>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 |
Once you know which data you have, it is time to know which algorithms are available and how to use them.
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 algs() 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.
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
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.
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 describealg(name of the algorithm) method. Use the command-line name of the algorithm, not the full descriptive name.
For example, if we want to calculate a ow accumulation layer from a DEM, we will need to execute the corresponding module, which, according to the list show using the ags() method,is identified as accflow. The following is a description of its inputs and outputs.
>describealg("accflow") Usage: accflow(DEM[Raster Layer] WEIGHTS[Optional Raster Layer] METHOD[Selection] CONVERGENCE[Numerical Value] FLOWACC [output raster layer])
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: runalg. Its syntax is as follows:
> runalgname_of_the_algorithm, param1, param2, ..., paramN)
The list of parameters to add depends on the algorithm you want to run, and is exactly the list that the describealg method gives you, in the same order as shown.
Depending on the type of parameter, values are introduced differently. The next one is aquick review of how to introduce values for each type of input parameter
For example, for the maxvaluegrid algorithm:
Usage: runalg("maxvaluegrid", INPUT[Multiple Input - Raster Layer] NODATA[Boolean], RESULT[Output raster layer])
The next line shows a valid usage example:
> runalg("maxvaluegrid", "lyr1, lyr2, lyr3", "false", "#")
Of course, lyr1, lyr2 and lyr3 must be valid layers already loaded into gvSIG.
When the multiple input is comprised of raster bands, each element is represented by a pair of values (layer, band). For example, for the cluster algorithm:
Usage: runalg ("cluster", INPUT[Multiple Input - Band] NUMCLASS[Numerical Value]) ***************
The next line shows a valid usage example:
> runalg("cluster, "lyr1, 1, lyr1, 2, lyr2, 2", 5, "#", "#")
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).
runalg("kernelfilter", mdt25.asc, "-1, -1, -1, -1, 9, -1, -1, -1, -1", "#")
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.
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 "#".
Just like when you execute a geoalgorithm from the toolbox, when it generates new raster layers you have to define the extent and cellsize of those layers.
By default, those characteristics are defined based on the input layers. You can toggle this behaviour using the autoextent command.
> autoextent("true"/"false)
If you want to define the output raster characteristics manually or using a supporting layer, you have to use the extent command, which has three different variants.
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
When this command is used, the autoextent functionality is automatically deactivated.
Every time you execute a SEXTANTE algorithm, information about the process is stored in the SEXTANTE history manager. Along with the parameters used, the date and time of the execution are also saved.
This way, it is easy to track the and control all the work that has been developed using SEXTANTE, and easily reproduce it.
The SEXTANTE history manager is a set of registries grouped according to their date of execution, making it easier to find information about an algorithm executed at any particular moment.
Process information is kept as a command-line expression, even if the algorithm was launched from the toolbox. This makes it also useful for those learning how to use the command-line interface, since they can call an algorithm using the toolbox and then check the history manager to see how that same algorithm could be called from the command-line.
Apart from browsing the entries in the registry, processes can be reexecuted, simply double-clicking on the corresponding entry.