[GRASS-user] Re: [GRASS-dev] More efficient to use r.mapcalc or r.patch in a loop for creating mosaics?

Maciek Sieczka werchowyna at epf.pl
Thu May 11 14:52:14 EDT 2006


On Thu, 11 May 2006 14:16:32 -0300
"Patton, Eric" <epatton at nrcan.gc.ca> wrote:

> I'm writing a script to mosaic an arbitrary number of rasters
> together. So far, the script works fine, using the following mapcalc
> statement in a 'for' loop:
> 
> r.mapcalc "$OUTPUT=if(isnull(Map_A), Map_B, Map_A)"
> 
> I should note that I'm reading the map names in through an array
> which was populated in a previous step. My question is: Is there an
> advantage in using r.mapcalc over using r.patch for this work? At 1m
> resolution rasters, and about 60+ of them, this could take a long
> time.

How about GDAL?

gdal_translate to create an empty raster, of the target extents

write your maps into it with gdalwarp one by one

It should be faster than Grass.

There's also gdal_merge.py but it consumes lots of memory and may fail.

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/




More information about the grass-user mailing list