How do I compare two rasters based on pixel value?

81
4
08-08-2022 11:34 AM
Labels (2)
EH_Alaska
New Contributor II

What I want to do is take the 2010-2019 and 2040-2049 rasters here and create a new layer that highlights only pixels where the value rises above freezing (0°C) between them. The end result will show where we can expect permafrost to thaw in the next 20-ish years in Alaska.

I've worked with rasters only a handful of times, so I feel a bit out of my element here. Are there any tools, equations, etc. for accomplishing this?

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

("2040-2049" - "2010-2019) >= 0

Would give you a boolean mask where the above is true (1) or false (0)

You can do this in the Raster Calulator


... sort of retired...
0 Kudos
EH_Alaska
New Contributor II

Hello Dan! Thank you for the suggestion. I attempted to perform the calculation, but I received the following error:

ERROR 000539: Error running expression: rcexec()
Traceback (most recent call last):
File "<expression>", line 1, in <module>
File "<string>", line 8, in rcexec
RuntimeError: ERROR 010240: Could not save raster dataset to 2010_2040 with output format GRID.

Failed to execute (RasterCalculator).

I'm not sure why it would be throwing this error. Any ideas?

0 Kudos
DanPatterson
MVP Esteemed Contributor

save it as a tiff in a folder, which is the preferred raster format

eg  c:/your_folder/rast_2010_2040.tif

GRID's cant begin with numbers and there a whole load of other restrictions


... sort of retired...
0 Kudos
DanPatterson
MVP Esteemed Contributor

fixed?


... sort of retired...
0 Kudos