#1365: Import raster files - Batch import
------------------------------------------------+---------------------------
Reporter: lluis | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: wxGUI | Version: unspecified
Keywords: import, batch, raster files, wxGUI | Platform: Linux
Cpu: x86-64 |
------------------------------------------------+---------------------------
I have several Arc/Info ASCII Grid files (up to 100) but when I try to
import it into GRASS I can't get any result.
If I select Directory as a Source Type, and I write the path to the folder
that contains the raster layers (selecting Arc/Info ASCII Grid as Format),
no layers appear on List of GDAL Layers. Is like if GRASS doesn't
recognize the layers. It doesn't matter if the extension of the raster
layers is *.txt or *.asc
On the other hand, I can import the files one by one (selecting File as a
Source Type) but I can't do it as batch. Any hint? If I do it from the
terminal it works fine, so I suppose that it is a problem with the wxGUI:
"for txt in *.txt; do r.in.gdal -o in="${txt}" out="${txt}" ; done"
I experienced this problem on grass 6.4.2svn and grass7.
> for txt in *.txt; do r.in.gdal -o in="${txt}" out="${txt}" ; done
no idea about the wxgui bug, but fwiw in the scripting, ${} does nothing,
just use "$txt", and you can strip off the .txt from the output name with
either {{{ out=`basename "$txt" .txt` }}}, or back with the curly
brackets: {{{ out="${txt%.txt}" }}}.