[GRASS-user] Batch import

I am trying to import several hundred images into Grass. This is obviously painful to do by hand. I've tried searching for batch scripts but haven't found one. Can anyone help?

(please keep this on-list)

Shaun Langley wrote:

>> I am trying to import several hundred images into Grass. This is
>> obviously painful to do by hand. I've tried searching for batch scripts
>> but haven't found one. Can anyone help?

Nikos Alexandris:

> Linux or Window$?

Shaun Langley:

Mac or Linux

You can use bash (the well known shell under most Linux distros) one-liners or
script(s). Something like:

# enter in the directory which holds the images
# assuming all are Geotiff and lie on the same spatial reference system
cd Directory

# use r.in.gdal within a "for" loop
for TIF in *.tif; do r.in.gdal in="${TIF}" out="${TIF}" ; done

# or to avoid the ".tif" in the name of the imported grass
for TIF in *.tif ; do r.in.gdal in="${TIF}" out="`echo ${TIF} | cut -d"." -
f1`" ; done

Under the GUI I have no idea (currently).

Good luck, Nikos

Hi,

2010/6/24 Nikos Alexandris <nikos.alexandris@felis.uni-freiburg.de>:

Under the GUI I have no idea (currently).

in wxGUI

File -> Import raster/vector data -> Bulk import of raster/vector data

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

[back to ML]

Hi,

2010/6/26 Shaun Langley <shaunlangley@gmail.com>:

That's interesting. Can you tell me what wxGUI is and where I cab get it?

wxGUI [1] is new generation of GUI for GRASS. It's available in GRASS
6.4+. Start GRASS with `wx` switch.

grass -wx

or in running session by

g.gui wxpython

Martin

[1] http://grass.osgeo.org/wiki/wxGUI

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa