[GRASS-user] grass env
glynn at gclements.plus.com
Tue Mar 2 12:04:43 EST 2010
maven apache wrote:
> I have post this problem before, I want to run grass in command line model
> so I can call them in java at that time,however it often cause some
> unexpeced errors.
> So today I change to Ubuntu, and I install grass use sudo apt-get install
> Now I also want to call grass in my java code but in the Ubuntu platform, I
> want to know which environment variables are needed, so I did some tests.
> First I run grass in text model in the ternimal by " grass -text",
> and I chose the location and mapset,it works, then I use command "set >
> /home/kk/var" to get all the environment variablse using by grass ,then I
> open a new ternimal to get the normal env vars by " set > /home/kk/varn" .
> Then I compare the two files and tried to find the differences. I found
> that there are more variables in the varn rather than var (shown below):
> GRASS_GNUPLOT='gnuplot -persist'
> So I want to know if these vars are enough?
You also need:
[PYTHONPATH is only relevant if running Python scripts which use the
Many of the above are unnecessary.
GRASS_TCLSH and GRASS_PERL aren't used. GRASS_SH is only used on
Windows. GRASS_PROJSHARE defaults to /usr/share/proj if not set.
GRASS_WISH, GRASS_PYTHON, GRASS_HTML_BROWSER and GRASS_LD_LIBRARY_PATH
are only relevant for interactive use. GRASS_GNUPLOT is only used by
Although it shouldn't matter, I suggest GRASS_PAGER=cat and
If you need to use any display commands, you also need to set
GRASS_RENDER_IMMEDIATE=TRUE, and may want to use some of the variables
documented in the "pngdriver" manual page to control the output.
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-user