Re: [GRASS-user] compositing rasters

2014-01-01 Thread Dave Roberts
Tyler, Well, that's simply brilliant. I knew it should be easy. Plus, when I tested it I found out my rasters weren't truly mutually exclusive after all, as some cells = 3. This is apparently an artifact of v.to.rast polygon boundary issues but it's a pretty small problem. Nonethe

Re: [GRASS-user] compositing rasters

2014-01-01 Thread Tyler Smith
Dave Roberts wrote: >Colleagues, > >I know this must be easy, but I haven't found it. > > Suppose I have three grids (a, b, and c) where each grid is 0 or 1, >and the 1s are mutually exclusive. I want a new grid where if grid >a=1 then newgrid = 1; if grid b=1 then new grid = 2; if grid c=

Re: [GRASS-user] compositing rasters

2014-01-01 Thread Dave Roberts
Friends, I did get an off-list solution (thanks Jiao) that works for two rasters but not for n (using the implied else). I think what GRASS needs is an r.update routine that works like an SQL update statement, i.e. r.update map=composite.map value=1 where="map a = 1" r.update map=comp

[GRASS-user] compositing rasters

2013-12-31 Thread Dave Roberts
Colleagues, I know this must be easy, but I haven't found it. Suppose I have three grids (a, b, and c) where each grid is 0 or 1, and the 1s are mutually exclusive. I want a new grid where if grid a=1 then newgrid = 1; if grid b=1 then new grid = 2; if grid c=1 then newgrid = 3. S