[GRASS-user] sum of several raster maps

Hamish hamish_nospam at yahoo.com
Thu Apr 19 21:31:14 EDT 2007


> Andi wrote:
> > I have several Raster Maps (1 - 365). I would like to create one map
> > by adding all these maps together. 
> > Is there any function to do so without using 
> > 
> > r.mapcalc map = map1 + map2 + map3....+map365
>

Otto wrote:
> what about r.series input=map1,map2,map3,.. method=sum ?


Note prior to GRASS 6.2 there was a limit on the maximum number of open
files in lib/gis/G.h (256), but that has since been removed. You used to
have to increase that number to 400 or so and recompile GRASS to use
that many maps. Also the number of open files must be smaller than the
operating system's limit. (Given by `cat /proc/sys/fs/file-max` in Linux
2.4)  See the comments in raster/r.patch/nfiles.h in the source code.
(can we increase or remove the limit in r.patch now?)

g.mlist is your friend for constructing a comma separated list of input
maps.


Hamish




More information about the grass-user mailing list