[GRASS-user] Import a catalog of ascii *.arc files and merge to a raster

Lars Forseth lars.forseth at ntebb.no
Sun Apr 1 13:33:15 EDT 2012


Hi!
In help for r.patch I found this:

MAPS=`g.mlist type=rast sep=, pat="map_*"`
g.region rast=$MAPS
r.patch in=$MAPS out=mosaic

That worked for me now.

I importet all files in the catalog by defining import source in the gui 
for r.in.gdal as directory; choosing the right directory; and it then 
imported all the files, giving them a "prefix" of x2; or some such.

I shall try Markus suggestions next!

regards; and thanks!

larsf

Den 01. april 2012 18:42, skrev Markus Metz:
> Lars Forseth wrote:
>> Thanks Daniel.
>>
>> But no, I was not able to make your suggestion work; it complains that it
>> dos not know the command 'For'...
> In Linux shell and msys this must be lowercase, i.e.
>
> for i in *.arc
> do r.in.arc $i<output name here>
> done
>
> or
>
> for i in *.arc
> do r.in.arc in=$i out=`basename $i .arc`
> done
>
> followed by something like
>
> raster_list=`g.mlist type=rast pat=<insert search pattern here>  sep=comma`
> g.region -p rast=$raster_list
> r.patch in=$raster_list out=<output name here>
>
> HTH,
>
> Markus M
>
>> Regards larsf
>>
>>
>> Den 01. april 2012 16:01, skrev Daniel Victoria:
>>
>> I believe there is a batch import function in the gui ( I'm not in front of
>> my computer now). If not, you can write a for loop in the command line to
>> import all files.
>> In Linux shell it's something like
>> For i in *.arc
>> Do r.in.arc $i<output name here>
>> Done
>>
>> Daniel
>>
>> On Apr 1, 2012 10:13 AM, "Lars Forseth"<lars.forseth at ntebb.no>  wrote:
>>> Hi!
>>> I want to import a set (20) of ESRI ASCII raster files in a catalog, and
>>> merge them to a single GRASS raster dataset.
>>>
>>> How do I do that? (Yes I can import each file, and then merge (r.patch),
>>> but..)
>>>
>>> Regards larsf
>>>
>>>
>>> _______________________________________________
>>> grass-user mailing list
>>> grass-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>>
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>



More information about the grass-user mailing list