Raster Percentage Difference

2184
2
04-07-2019 02:10 AM
Labels (2)
FrithjofThomsen
New Contributor

Hello fellow ArcMap User, 

i´ve got a question. 

Im using ArcMap 10.6.1 on Win10 with full license. 

I am trying to find a possible way but haven´t found it yet. 

I want to see the percentage (and absolute but percentage is more important) difference between two raster-datasets. Is there any way to make this happen with raster-math or something else? 

My task is about inundation areas in urban regions and i want to compare two different approaches. 

I am pretty new to the software and appreciate any help from experienced user. 

Thank you very much i am looking for your answer. 

0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus

What have you tried?

Do you have the spatial analyst extension?

In the raster calculator, subtract the two and then divide by the raster that you are using as the denominator...multiply the result by 100%.  Of course if will fail miserably if you have 0 in the raster you are using as the denominator, so extra efforts will be needed to mask those cells.

0 Kudos
MattMoy
New Contributor II

Hey Dan,

I'm attempting something similar to what the original poster was asking about. I have 0 values in the denominator layer. I was going to try to create an if/then statement to prevent an error from being thrown but can't seem to figure out how to use if/then in the raster calculator.

Others have suggested using a Field Calculator, which allows for if/then statements, but this doesn't (to my knowledge) allow me to pull in a value from a different layer. Any suggestions?

The if/then statement would look something like this:

def PrcntChng(OldVal, NewVal):

  if OldVal == 0:

    PC = 0

  else:

    PC = ((NewVal - OldVal) / OldVal) * 100

  return PC

0 Kudos