[GRASS-user] Add up several maps, which hold different regions, with mapcalc

Marcello Gorini gorini at gmail.com
Mon Jun 18 05:03:55 PDT 2012


I knew it! Just testing you all.... :)


On Mon, Jun 18, 2012 at 12:54 PM, Paulo van Breugel
<p.vanbreugel at gmail.com>wrote:

>  First set the region to fit all maps, like suggested by Marcello. Then,
> use r.patch to combine the maps.
>
> Cheers,
>
> Paulo
>
>
>
>
> On 06/18/2012 01:36 PM, Marcello Gorini wrote:
>
> Büro Seling said:
>
>
>> My problem begins, when I now try to add up all these single maps into
>> one larger map.
>> I searched for a solution and tried several things, but nothing worked.
>>
>> Any tipps or hinds?
>>
>
>
> Hey,
>
> As always, there is probably a much more elegant solution to this problem,
> but this should get you going for now:
>
> >  g.region
> rast=map1,map2
> # just to make sure your region encompass everything
> > r.mapcalc
> "bigmap=if(isnull(map1),99999,map1)+if(inull(map2),99999,map2)"       #
> replace nulls on the fly by a specific value that your data does not contain
> > r.mapcalc
> "bigmap=if(bigmap==99999,null(),bigmap)"
> # put back the nulls
>
> Well, ugly like all my codes, but it works.
>
> Cheers,
> Marcello.
>
>
>
>
>
> This body part will be downloaded on demand.
>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20120618/9bc003fd/attachment-0001.html>


More information about the grass-user mailing list