# Cell statistics sum resulting cells to indicate original input rasters

I have 5 rasters (habitat suitability models for 5 different species) that I have set to the value 1, I have then used the Cell stats (ArcGIS 10.0) to add the rasters together so I can see the overlap i.e. were 5 rasters overlap a corridor in that location would be better than in a place were only 2 rasters overlap.

What I want to do is have a field (s) added to the summed raster that tells me which of the original rasters overlap at that location. i.e. in location 1. the frog and bird raster overlap etc. this would need to be done for every cell in the final raster. I think maybe lookup or raster calculator but it is a bit beyond me and I don't want to go to vector...

There are a few similar questions on here but not exactly and I can't make them work

• If you have seen similar questions here can you please provide links to them and say what did not work with them by editing your question, please? That way those Q&As can be improved to help you and future users find the answers that they seek. – PolyGeo May 15 '15 at 0:32
• Could you do the 'binary' thing, frog = 1 (0b00000001), bird = 2 (0b00000010), dog = 4 (0b00000100), cat = 8 (0b00001000) then add them. Due to the nature of binary numbers you can get at any stage the codes back again using binary OR. – Michael Stimson May 15 '15 at 0:53
• I tried combine, merge, sum Lookup – Amanda May 15 '15 at 1:28
• You'd have to start with CON(ISNULL(R),0,x) where R is the raster and X is the value for each raster then use SUM to add them up... up to 64 rasters can be combined like this. – Michael Stimson May 15 '15 at 4:59
• @Michael Your idea is a good one and it is more workable than you suggest. With five rasters, for instance, with names "A" through "E", one solution is to compute ((("A"*2+"B")*2+"C")*2+"D")*2+"E". Up to 2^5=32 values (plus NoData) would result, which are then easily reclassified into lists of the original raster names. The practical limit to this approach is 31 rasters (after that, the values overflow signed integers). It can be far faster to perform than a huge Combine operation. – whuber May 15 '15 at 17:59

## 1 Answer

You need to use the Combine tool. Unlike simply adding together the rasters to get a total, this tool will create a new raster with values based on the unique combination of the other rasters. So the value created where frog and bird overlap will be different than that where frog and fox overlap, which is different yet again from where bird and fox overlap.

Related question: Combine multiple binary rasters to a single raster which doesn't specify identifying the input values in the final so not a duplicate. There is, however, an alternate solution there that describes using bitwise algebra to solve the problem (pretty much what Michael mentions in his comment).

• Hello,i tried the combine tool. it didnt work. the result i got was that the raster was the same as the first input raster and the value given for bird and reptile was the same, ie 1 for all cells. i actually need the value for cells to be different based on when they overlap. – Amanda May 15 '15 at 1:27
• @user23828 Well something isn't right then. Are your rasters integer value? They can't be floats. Are the cells that are not 1 set to zero, or are they nodata/null? Must be zero, can't be nodata. Do they all share the same origin and extents? Can you post the rasters anywhere so we could take a look? Perhaps include a screenshot of them and their value ranges/information. – Chris W May 15 '15 at 1:32
• it was the NoData sorry what a silly mistake! – Amanda May 15 '15 at 1:43
• Ok so the above worked great! I am working on the next step.I have a weighted overlay that identifies the most important areas in a corridor scaled from 0 - 100. I would like to be able to click on a cell and be able to identify which input rasters contributed to the weighted overly. so i think i should convert all inputs into weighted overlay to a value of 1, do a combine as above and then combine with the weighted overlay? – Amanda May 21 '15 at 1:25