Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The requested maximum operator is a function that produces a new raster with the highest values on a cell-by-cell basis from an array of coincident input rasters. It is the kind of Maximum Support classification performed by the 'HARDEN' tool of the Idrisi software.

The raster calculator spatial analyst tool should be used.

I tried


But got the following error: 'exceptions.ValueError': The truth value of the raster is ambiguous

Thanks in anticipation

share|improve this question
up vote 5 down vote accepted

I believe the "max" keyword in raster calculator was deprecated with the transition from ArcGIS 9.x to ArcGIS 10. So Rasto's answer probably won't work in ArcGIS 10 (it didn't for me when I just tried it).

If you have only two rasters, you can still make a condition statement to find the maximum using the "Con" keyword in map algebra. The syntax is


so to find the maximum of two rasters you'd do

Con("Raster1" > "Raster2","Raster1","Raster2")

If you have more than two rasters, you can run Cell Statistics in Spatial Analyst with a "MAXIMUM" parameter on an arbitrarily number of inputs.

share|improve this answer
Thanks Man! this (cell statistics) works, it's only that I need a map algebra syntax for 'maximum' on many (7) raster layers . I'm required to build a complex python expression upon this pls. – Hyipro Dec 13 '11 at 15:37
You should be able to add as many raster layers as you want to the cell statistics geoprocessing tool. So Python would be outRaster = CellStatistics([Raster1,Raster2,Raster3,Raster4,Raster5,Raster6,Raster7], "MAXIMUM") – dmahr Dec 13 '11 at 15:45
CellStatistics(["Raster1","Raster2","Raster3","Raster4","Raster5"],"MAXIMUM","DA‌​TA") – Hyipro Dec 13 '11 at 15:54
thanks a million, This works perfectly. U're the Best! – Hyipro Dec 13 '11 at 15:56
No problem. Be sure to make this question as "answered" whenever you get a chance. – dmahr Dec 13 '11 at 15:58

I Just completed somthing similar, exept i used the Minimum parameter (on 700 rasters). If you are looking to execute the tool on more than two rasters use the list data method and then use it as the variable in the tool. Good Luck!

share|improve this answer

use max([raster_A],[Raster_B],[Raster_C],[Raster_D])

share|improve this answer
Doesn't this just reproduce the syntax the OP found not to work? – whuber Dec 13 '11 at 17:33

Your Answer


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.