Difference between revisions of "GRASS and Sextante"

From GRASS-Wiki
Jump to: navigation, search
(+ref)
(Updated to gvSIG 1.10+)
Line 53: Line 53:
 
== Alternative: How to install (original gvSIG version) ==
 
== Alternative: How to install (original gvSIG version) ==
  
# Download gvSIG binaries from [http://www.gvsig.gva.es/ here]
+
From gvSIG 1.10 onwards, Sextante is included:
# Download Raster Pilot from [http://www.gvsig.gva.es/gvsig-desktop/desk-extensiones/ext-pilotoraster/ext-piloto-descargas/ here]
 
# Download Sextante binaries from [http://forge.osor.eu/plugins/wiki/index.php?Downloads&id=13&type=g here]
 
  
=== Linux ===
+
# download gvSIG binaries from [http://www.gvsig.org/web/home/gvsig-en/view?set_language=en here] (download the '''All-included version''')
 
+
# run the installer
Now you have three files, for example: gvSIG-1_1_x-raster_pilot-BN7-linux-i586.bin, gvSIG-1_9-linux-i586-withjre.bin, and sextante.zip
+
# start gvSIG
 
 
You have to run (follow the dialogs):
 
 
 
sh gvSIG-1_9-linux-i586-withjre.bin
 
sh gvSIG-1_1_x-raster_pilot-BN7-linux-i586.bin
 
 
 
To install the content of sextante.zip:
 
 
 
# software
 
mkdir /PATH/TO/gvSIG_1.9/bin/gvSIG/extensiones/es.unex.sextante
 
cd /PATH/TO/gvSIG_1.9/bin/gvSIG/extensiones/es.unex.sextante
 
 
 
unzip /PATH/TO/sextante.zip "core/*"
 
mv core/* .
 
rmdir core
 
unzip /PATH/TO/sextante.zip "bindings/gvsig_1_9/*"
 
mv bindings/gvsig_1_9/* .
 
rmdir bindings/gvsig_1_9  bindings
 
 
rm -f jts-1.9.jar
 
 
 
# help:
 
cd /PATH/TO/gvSIG_1.9/bin/gvSIG/extensiones/
 
mkdir sextante_help
 
unzip /PATH/TO/sextante.zip "help/*"
 
mv help/* help/
 
rmdir help
 
 
If you installed it with JRE usage (default), you now have to remove some files to avoid conflicts with the main gvSIG installation:
 
rm -f sextante_flowTools-0.55.jar flowmap.jar j3dcore.jar prefuse*.jar vecmath-1.3.jar
 
 
 
Now you can launch gvSIG, from the Desktop or via (adjust path):
 
  /usr/local/gvSIG_1.9/bin/gvSIG.sh
 
 
 
=== Windows ===
 
 
 
TBD.
 
 
 
=== MacOSX ===
 
 
 
TBD.
 
  
 
== Activating GRASS in Sextante ==
 
== Activating GRASS in Sextante ==
  
''(cited after grass_sextante.html)''
+
''(modified after grass_sextante.html)''
  
 
Configuring Sextante to use GRASS takes just a few easy steps. Once you have configured the system, you will be able to execute GRASS algorithms from any Sextante component like the toolbox or the graphical modeller, just like you do with any other Sextante geo-algorithm.
 
Configuring Sextante to use GRASS takes just a few easy steps. Once you have configured the system, you will be able to execute GRASS algorithms from any Sextante component like the toolbox or the graphical modeller, just like you do with any other Sextante geo-algorithm.
Line 112: Line 69:
 
* The path to a GRASS mapset. The mapset doesn't have to contain any data at all, since data will be imported automatically each time you execute an algorithm. The only important part of the mapset is the location information, particularly the Coordinate Reference System. You must set the same CRS that is used by the layers that you want to process using GRASS algorithms. If, for instance, you have layers with data in the EPSG 23030 reference system, you must set the mapset to that same reference system. When data is imported into the mapset, no reprojection is performed, and layers are assumed to be in the same projection as the mapset itself.
 
* The path to a GRASS mapset. The mapset doesn't have to contain any data at all, since data will be imported automatically each time you execute an algorithm. The only important part of the mapset is the location information, particularly the Coordinate Reference System. You must set the same CRS that is used by the layers that you want to process using GRASS algorithms. If, for instance, you have layers with data in the EPSG 23030 reference system, you must set the mapset to that same reference system. When data is imported into the mapset, no reprojection is performed, and layers are assumed to be in the same projection as the mapset itself.
  
# Go to Sextante settings (open Sextante Dialog -> right of the "Search" bar)
+
* Open the '''Sextante Toolbox icon'''
# Go to "GRASS"
+
* Go to Sextante settings (open icon -> right of the "Search" bar at bottom of the window)
# Set therein
+
* Go to "GRASS"
 +
* Set therein
 
   GRASS folder: /path/to/grass-binary-installation/  (e.g., /usr/local/grass-6.4.0svn/ )
 
   GRASS folder: /path/to/grass-binary-installation/  (e.g., /usr/local/grass-6.4.0svn/ )
 
   GRASS mapset: /path/to/grassdata/location/mapset  (e.g., /home/neteler/grassdata/nc_spm_08/sextante ) '''The mapset doesn't have to contain any data at all!'''
 
   GRASS mapset: /path/to/grassdata/location/mapset  (e.g., /home/neteler/grassdata/nc_spm_08/sextante ) '''The mapset doesn't have to contain any data at all!'''
Line 121: Line 79:
 
   grass64 -c /path/to/grassdata/location/mapset  (e.g., grass64 -c /home/neteler/grassdata/nc_spm_08/sextante )
 
   grass64 -c /path/to/grassdata/location/mapset  (e.g., grass64 -c /home/neteler/grassdata/nc_spm_08/sextante )
 
   exit
 
   exit
 +
 +
* Click on "Setup GRASS" to register the raster and vector commands
 +
* Now click on the "Help" button to know that it is there and what it contains
 +
* Finally click "OK" to leave the dialog. Now 5xx Sextante/GRASS commands should be available
  
 
== How to use ==
 
== How to use ==

Revision as of 04:57, 14 April 2011

GRASS has been integrated into Sextante as extension. Sextante itself is commonly used within gvSIG. Through this integration, gvSIG users have access to the wealth of well tested algorithms provided by GRASS.

Note: the GDAL-GRASS plugin must be installed.

How to install (tuned OADE version)

  1. Download OADE gvSIG binaries from here
  2. Download Sextante binaries from here

Linux

Now you have three files, for example: gvsig-oade-2010-1.0.0.b2-linux-installer.bin and sextante.zip

You have to run (follow the dialogs; we assume that you install it in your HOME directory as predefined in the dialog). Install at least gvSIG, andthe included demo data:

chmod a+x gvsig-oade-2010-1.0.0.b2-linux-installer.bin
./gvsig-oade-2010-1.0.0.b2-linux-installer.bin

To update the pre-installed Sextante with the newer content of sextante.zip:

rm -rf $HOME/gvsig-oade-2010-1.0.0/bin/gvSIG/extensiones/es.unex.sextante
mkdir  $HOME/gvsig-oade-2010-1.0.0/bin/gvSIG/extensiones/es.unex.sextante
cd $HOME/gvsig-oade-2010-1.0.0/bin/gvSIG/extensiones/es.unex.sextante
unzip /PATH/TO/sextante.zip "core/*"
mv core/* .
rmdir core
unzip /PATH/TO/sextante.zip "bindings/gvsig_1_9/*"
mv bindings/gvsig_1_9/* .
rmdir bindings/gvsig_1_9  bindings

rm -f jts-1.9.jar
# help:
cd ../sextante_help
rm -rf en/ es/ de/
unzip /PATH/TO/sextante.zip "help/*"
mv help/* .
rmdir help

Now you can launch gvSIG, from the Desktop or via (adjust path if you didn't use the default installation directory):

 $HOME/gvsig-oade-2010-1.0.0/bin/gvSIG.sh

Windows

TBD.

MacOSX

TBD.

Alternative: How to install (original gvSIG version)

From gvSIG 1.10 onwards, Sextante is included:

  1. download gvSIG binaries from here (download the All-included version)
  2. run the installer
  3. start gvSIG

Activating GRASS in Sextante

(modified after grass_sextante.html)

Configuring Sextante to use GRASS takes just a few easy steps. Once you have configured the system, you will be able to execute GRASS algorithms from any Sextante component like the toolbox or the graphical modeller, just like you do with any other Sextante geo-algorithm.

Only two parameters must be set, namely:

  • The path to the GRASS installation folder. It is needed by Sextante to execute GRASS commands.
  • The path to a GRASS mapset. The mapset doesn't have to contain any data at all, since data will be imported automatically each time you execute an algorithm. The only important part of the mapset is the location information, particularly the Coordinate Reference System. You must set the same CRS that is used by the layers that you want to process using GRASS algorithms. If, for instance, you have layers with data in the EPSG 23030 reference system, you must set the mapset to that same reference system. When data is imported into the mapset, no reprojection is performed, and layers are assumed to be in the same projection as the mapset itself.
  • Open the Sextante Toolbox icon
  • Go to Sextante settings (open icon -> right of the "Search" bar at bottom of the window)
  • Go to "GRASS"
  • Set therein
  GRASS folder: /path/to/grass-binary-installation/  (e.g., /usr/local/grass-6.4.0svn/ )
  GRASS mapset: /path/to/grassdata/location/mapset  (e.g., /home/neteler/grassdata/nc_spm_08/sextante ) The mapset doesn't have to contain any data at all!

Note: you need to create this mapset with GRASS

  grass64 -c /path/to/grassdata/location/mapset  (e.g., grass64 -c /home/neteler/grassdata/nc_spm_08/sextante )
  exit
  • Click on "Setup GRASS" to register the raster and vector commands
  • Now click on the "Help" button to know that it is there and what it contains
  • Finally click "OK" to leave the dialog. Now 5xx Sextante/GRASS commands should be available

How to use

GRASS is used in an internal temporary session.

Sample session:

  1. File -> open Project -> $HOME/gvsig-oade-2010-1.0.0/sample_data/north_carolina.gvp
  2. Open Sextante dialog
  3. Go to "Indices and other hydrological parameters"
  4. Start (double click) r.topidx, select as Input "Elevation", as output write "topidx.tif" (it will go into your current directory; check with browse button), click OK
  5. It should have generated a new map.

See also