Hi:
I am using grass6.4 on xp platform.
I notice that the grass icon in the desktop is a shortcut of grass64.bat under the grass intall directory. it is “F:\anzhuang\GRASS-6-SVN\grass64.bat -wxpython”
Then I open the grass64.bat, it just set some GRASS variables and environment variables. So I think I can create a bat and do some grass process in the command line manner.
My bat is :
set GRASSDIR=F:\anzhuang\GRASS-6-SVN
set HOME=%USERPROFILE%
set PATH=%path%;%GRASSDIR%\bin;%GRASSDIR%\lib;%GRASSDIR%\etc;%GRASSDIR%\extralib;%GRASSDIR%\sqlite\lib;%GRASSDIR%\sqlite\bin;%GRASSDIR%\driver\db;%GRASSDIR%\extrabin;
set GISRC=C:\Documents and Settings\Administrator.grassrc6
I save it as grassStart.bat at D driver.
Then I open a new command, run: D:\grassStart.bat, then I use "set " to see the path variable, the grass variables have been added.
Then I want to run a grass command : r.info ,however it deosnot work. The error message box can be found here:http://imagebin.org/82527
I hope some one can check it .
In fact what I want to do is set the grass environment variables once the jvm startup, then I can call grass do some process in java.
Nobody?
In fact I mean how can I run grass in a common windows xp command line.
I have read this page:http://grass.osgeo.org/wiki/GRASS_and_Shell,however it is about linux, and I am not sure which environment is requried. Also I may need to change the location and mapset after import a data(for example a geotiff).
maven apache wrote:
In fact I mean how can I run grass in a common windows xp command line.
I have read this page:http://grass.osgeo.org/wiki/GRASS_and_Shell,however it
is about linux, and I am not sure which environment is requried.
The same principles can be applied to any language and any operating
system.
The main point is that the GRASS libraries expect certain environment
variables to be set (mainly GISBASE and GISRC), and the file
referenced by GISRC should contain settings for GISDBASE,
LOCATION_NAME, and MAPSET.
There is a list of environment variables in the file
$GIBASE/docs/html/variables.html (lib/init/variables.html in the
source tree).
Variables relating to specific display drivers are listed in the
driver's documentation (e.g. pngdriver.html for the PNG driver).
Also I may need to change the location and mapset after import a
data(for example a geotiff).
You can use g.mapset or g.gisenv to change these parameters.
--
Glynn Clements <glynn@gclements.plus.com>
In fact , I wonder if I can set the variables in the .grassrc to the path, then I can work without the .grassrc?
- $HOME/.grassrc6
- stores the GRASS variables (but not environment variables)
- Note this, is there any differences between grass variables and envrionment viriables?
2010/1/31 Glynn Clements <glynn@gclements.plus.com>
maven apache wrote:
In fact I mean how can I run grass in a common windows xp command line.
I have read this page:http://grass.osgeo.org/wiki/GRASS_and_Shell,however it
is about linux, and I am not sure which environment is requried.
The same principles can be applied to any language and any operating
system.
The main point is that the GRASS libraries expect certain environment
variables to be set (mainly GISBASE and GISRC), and the file
referenced by GISRC should contain settings for GISDBASE,
LOCATION_NAME, and MAPSET.
There is a list of environment variables in the file
$GIBASE/docs/html/variables.html (lib/init/variables.html in the
source tree).
Variables relating to specific display drivers are listed in the
driver’s documentation (e.g. pngdriver.html for the PNG driver).
Also I may need to change the location and mapset after import a
data(for example a geotiff).
You can use g.mapset or g.gisenv to change these parameters.
–
Glynn Clements <glynn@gclements.plus.com>
maven apache wrote:
In fact , I wonder if I can set the variables in the .grassrc to the path,
then I can work without the .grassrc?
No.
$HOME/.grassrc6s tores the GRASS variables (but not environment variables)Note
this, is there any differences between grass variables and envrionment
viriables?
Yes, there's quite a lot of difference between them.
Environment variables are implemented by the operating system. Each
process has its own set of environment variables, which are inherited
from its parent.
GRASS variables are implemented by the GRASS libraries, and stored in
the file referenced by the GISRC environment variable.
--
Glynn Clements <glynn@gclements.plus.com>
2010/1/31 Glynn Clements <glynn@gclements.plus.com>
maven apache wrote:
In fact , I wonder if I can set the variables in the .grassrc to the path,
then I can work without the .grassrc?
No.
$HOME/.grassrc6s tores the GRASS variables (but not environment variables)Note
this, is there any differences between grass variables and envrionment
viriables?
Yes, there’s quite a lot of difference between them.
Environment variables are implemented by the operating system. Each
process has its own set of environment variables, which are inherited
from its parent.
So , I want to know if I can set all of them to the path environment variables?
GRASS variables are implemented by the GRASS libraries, and stored in
the file referenced by the GISRC environment variable.
–
Glynn Clements <glynn@gclements.plus.com>