[GRASS-user] batch processing for raster import

Maciej Sieczka tutey at o2.pl
Tue Nov 13 06:40:21 EST 2007


Christoph Knoll wrote:
> Hello everybody,
> 
>  I am working with airborne laser scanner data and I need to import more than
> 2000 raster-datasets into my GRASSDatabase. I started to import the data with
> r.in.gdal (it works perfect) but if I do everything myself, I will still be
> importing the data still in a week or so.
> 
> Who can tell me how to write or who has a script for batch processing (importing
> the data with the r.in.gdal-command?

Christoph,

A one-liner:

for i in *.tif; do r.in.gdal in="$i" out=`basename "$i"
.tif`; done

Adjust the wildcard to match your input raster's extension
and supply more options for r.in.gdal if needed, according
to manual.

Maciek




More information about the grass-user mailing list