User Tools

Site Tools


wiki:grassvariables7

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:grassvariables7 [2017/12/05 22:53] (current)
Line 1: Line 1:
 +===== Setting GRASS70 variables for GRASS bash job =====
 +Insert these lines in your bash script allowing to run your script by bash name_script.sh. ​
 +Of course set the settled directories ​ in accordance to your directories.
 +\\
 +\\
 +\\
 +\\
 +\\
 +\\
  
 +<code bash>
 +echo "​GISDBASE:​ /​home/​user/​ost4sem/​grassdb" ​     >  $HOME/​.grass7/​rc$$
 +echo "​LOCATION_NAME:​ newlocation" ​               >> $HOME/​.grass7/​rc$$
 +echo "​MAPSET:​ PERMANENT" ​                        >>​ $HOME/​.grass7/​rc$$
 +echo "GUI: text" ​                                >>​ $HOME/​.grass7/​rc$$
 +echo "​GRASS_GUI:​ wxpython" ​                      >>​ $HOME/​.grass7/​rc$$
 +</​code>​
 +
 +
 +
 +
 +==== path to GRASS binaries and libraries: ====
 +
 +<code bash>
 +export GISBASE=/​usr/​lib/​grass70
 +export PATH=$PATH:​$GISBASE/​bin:​$GISBASE/​scripts
 +export LD_LIBRARY_PATH="​$GISBASE/​lib"​
 +export GISRC=$HOME/​.grass7/​rc$$
 +export GRASS_LD_LIBRARY_PATH="​$LD_LIBRARY_PATH"​
 +export PYTHONPATH="​$GISBASE/​etc/​python:​$PYTHONPATH"​
 +export MANPATH=$MANPATH:​$GISBASE/​man
 +
 +</​code>​
 +
 +====  use process ID (PID) as lock file number: ====
 +<code bash>
 +
 +export GIS_LOCK=$$
 +</​code>​
 +
 +==== settings for graphical output to PNG file (optional) ==== 
 +<code bash>
 +export GRASS_PNGFILE=/​tmp/​grass6output.png
 +export GRASS_TRUECOLOR=TRUE
 +export GRASS_WIDTH=900
 +export GRASS_HEIGHT=1200
 +export GRASS_PNG_COMPRESSION=1
 +</​code>​
 +
 +==== test if your script is able to use grass command by asking the  g.gisenv ==== 
 +
 +<code bash>
 +g.gisenv
 +</​code>​
wiki/grassvariables7.txt ยท Last modified: 2017/12/05 22:53 (external edit)