[GRASS-user] GRASS GIS 6.4 batch

Rasmus Borgstrøm Rb at gras.ku.dk
Thu Aug 19 07:36:16 EDT 2010


Dear Hamish

Thank you for your reply. 
As I understand you it is not possible to do the batch processing in Windows then?  (Unix is not an option here). 
If I am wrong about this, can you please explain me a bit further how to get started? I did not get much out of the "GRASS_BATCH_JOB" sections. 

Thank you in advance!

Best, 
Rasmus


>>> Hamish <hamish_b at yahoo.com> 19-08-2010 00:58 >>>
Rasmus wrote:
> I am fairly new to GRASS GIS and need some help on how to
> use GRASS GIS for batch jobs. 
> I have a series of 1000 MODIS sat-images that I want to
> batch-process in GRASS GIS in the following simple way:
> 
> r.in.gdal -e
> input=F:\Projects\LSTdaily\2000_065_LST_Day_1km.tif
> output=g2000_065_LST_Day_1km
> r.mapcalc "LST65_Celcius=float(2000_065_LST_Day_1km *
> 0.02)-273.15"
> r.mapcalc "LST65_Celcius0 = if(LST65_Celcius>-200,
> LST65_Celcius, null())"
> r.out.gdal -c input=LST65_Celcius0 nodata=-9999
> output=F:\Projects\BBMB\GRASSGIS\LST65_c.tif type=Float32
> 
> I know I can do this manually with the GRASS command line,
> but I would like to create a batch file where this can be
> executed from. 
> Thus the batch file should be able to open GRASS GIS and
> execute the few lines above without any interaction needed.

see "GRASS_BATCH_JOB"

http://grass.osgeo.org/grass64/manuals/html64_user/variables.html#enviro 

http://grass.osgeo.org/grass64/manuals/html64_user/grass6.html 

http://grass.osgeo.org/wiki/GRASS_and_Shell#GRASS_Batch_jobs 


> Does anyone have a similar batch-file I can look into, or
> can anyone assist me? I am not experienced within
> shell-programming and other things that I have found related
> to this topic. 
> 
> I am working on a Win XP/7 with GRASS GIS 6.4. 

that may be a problem. as far as I know the Windows startup
batch file bypasses the normal init.sh startup script, which
is what handles the batch job processing. Also it is built for
UNIX scripting, not msdos .bat files, so even if GRASS+MSys on
WinGrass could do it (perhaps it can?), you'd have to look into
writing it as a unix shell script. (in the most basic form a
unix .sh and msdos .bat are the same thing, just commands pasted
into a text file. things like automated loops are very different
though)


Hamish







More information about the grass-user mailing list