Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I would like to change all raster values in raster A that fall into the locations of category/class 1 of raster B.

Here, some more details. I did a calculation on a DEM resulting in different topography layers which I summed up to raster A. Now, I have a polygon map which I transferred into raster B. The class 1 of raster B should be an area that has only values of 1 in raster A. So I would like to use map algebra to change this (perhaps using a complex if() statement in GRASS GIS?)

I think I could have prevented all this earlier by simply applying a mask to the raster A before the calculations. However, the calculations took quite a while (2hours) so I would not like to repeat all the steps again...

any help is very much appreciated! Jens

share|improve this question
add comment

1 Answer

sooorry guys! I already found the solution...

in GRASS GIS using the map calculator

if(rasterA == 1, rasterB == 0, rasterB)

soo easy... :)

share|improve this answer
    
quite alright, just go ahead and select as the right answer, Maybe it would help others to know how/where you came across the answer. –  Brad Nesom Jan 11 '12 at 14:10
1  
yes, you are right. I have to wait a while since only after 21 hours I can accept my own answer. –  Jens Jan 12 '12 at 15:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.