User Tools

Site Tools


wiki:grassvariables

Differences

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

Link to this comparison view

wiki:grassvariables [2017/12/05 22:53] (current)
Line 1: Line 1:
 +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 "​LOCATION_NAME:​ europe" ​                    > ​ $HOME/​.grassrc6
 +echo "​MAPSET:​ PERMANENT" ​                        >>​ $HOME/​.grassrc6
 +echo "​DIGITIZER:​ none" ​                          >>​ $HOME/​.grassrc6
 +echo "​GRASS_GUI:​ text" ​                          >>​ $HOME/​.grassrc6
 +echo "​GISDBASE:​ /​home/​user/​ost4sem/​grassdb" ​              >>​ $HOME/​.grassrc6
 +</​code>​
 +# path to GRASS binaries and libraries:
 +<code bash>
 +export GISBASE=/​usr/​lib/​grass64
 +export PATH=$PATH:​$GISBASE/​bin:​$GISBASE/​scripts
 +export LD_LIBRARY_PATH="​$GISBASE/​lib"​
 +export GISRC=~/​.grassrc6
 +</​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/grassvariables.txt ยท Last modified: 2017/12/05 22:53 (external edit)