[GRASS-windows] run grass in command line

maven apache apachemaven0 at gmail.com
Mon Mar 1 00:06:43 EST 2010


HI:
I want to run grass in a command line model, however when I write a bat,it
works just for 6.3 version , and some command can not work for example I can
run g.version ,rather than r.fillnulls.
The grass variable bat is :
-------
@echo off

rem *******Environment variables***********

rem Set GRASS Installation Directory Variable
set GRASSDIR=F:\anzhuang\GRASS


rem set GISBASE=D:\GrassDataBase

set GISRC=C:\Documents and Settings\Administrator\.grassrc6

rem Set Path to utilities (libraries and bynaries) used by GRASS

set PATH=%GRASSDIR%\msys\bin;%PATH%
set PATH=%GRASSDIR%\extrabin;%GRASSDIR%\extralib;%GRASSDIR%\extrabin;%PATH%
set
PATH=%GRASSDIR%\tcl-tk\bin;%GRASSDIR%\sqlite\bin;%GRASSDIR%\gpsbabel;%PATH%
set
PATH=%PATH%;%GRASSDIR%\bin;%GRASSDIR%\lib;%GRASSDIR%\scripts;%GRASSDIR%\etc;%GRASSDIR%\sqlite\lib;%GRASSDIR%\sqlite\bin;


rem Path to the proj files (notably the epsg projection list)
set GRASS_PROJSHARE=%GRASSDIR%\proj
----------

And I write a work bat :
---------
r.in.gdal
input=D:\data\hdf5\new\OMI-Aura_L3-OMTO3e_2009m0729_v003-2009m0731t020127.tif
output=aa location=al
g.gisenv set=LOCATION_NAME=al
g.region rast=aa
r.null map=aa setnull=-1.267e+30--1.268e+30
r.fillnulls input=aa output=ab tension=40 smooth=0.1
r.out.gdal input=ab format=GTiff
output=D:/OMI-Aura_L3-OMTO3e_2009m0729_v003-2009m0731t020127.tif
---------
It does not work, it tell me that the r.fillnulls is not a valide command.
I wonder why?

In fact what I am trying to do is to call grass in my web application(like
the web processing service),now I want to handle the hdf5 data,the following
is my idea:
1) use gdalinfo to get the information of the he5,(the gdal model in grass
6.3 does not support this command, the 6.4 support)
2) change the subdataset to geotiff, use gdal_translate
3) import the tiff to grass and create a new location according the tif
4) log in to the new location use g.gisenv
5) set some sepical cell data to null by using r.null....
6) Interpolation the null data using r.fillnulls.
7) export the map to geotiff.

So anyone can give some advise?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-windows/attachments/20100301/0d3c89ff/attachment.html


More information about the grass-windows mailing list