I have 6 rasters with pixel values ranging from 0 to 1. I want to extract the highest pixel values from each raster to create a new raster, but also have a way to show which raster the highest value came from.

For example, pixel N has a value of 0.1 in Rast1, 0.5 in Rast2, 0.4 in Rast3. I would like to keep the value from Rast2 in the output raster and somehow keep track that this value came from Rast2 not Rast 1 or 3. Ultimately I would like to symbolize the raster by which original file it came from.

Is this possible?

  • Raster data can only store one value per cell. If you need to store multiple values for your analysis, consider a vector based approach. What is your ultimate objective? Why do you need to keep track of which raster has the highest value?
    – Aaron
    Commented Jan 7, 2016 at 0:23
  • 1
    Make 2 rasters... one with a value that identifies the raster that will be used and one with the value used. Con should be able to do that but the statement will be quite long. Commented Jan 7, 2016 at 0:25
  • 2
    No need for Con, use highest position tool, see answer below.
    – user2856
    Commented Nov 8, 2016 at 2:35

2 Answers 2

  1. Per the accepted answer, use the Cell Statistics tool to determine the maximum value of the rasters;
  2. Rather than an unwieldy Con function, use the Highest Position tool to determine which raster had the maximum value.
  • 1
    +1. This should be the answer, because Highest Position is designed to do precisely what the question asks for.
    – whuber
    Commented Nov 8, 2016 at 16:23

There might be a number of workarounds one way you can do this is in a 3 step process.

  1. Step 1. Use cell statistics tool in ArcGIS, to make a raster of maximum values from input raster1, raster2 and raster3.<- let step1 output = MaxValue
  2. Step 2. Use Conditional calculation: Con((Raster1 > Raster2)& (Raster1 >Raster3),1,Con((Raster2> Raster1)&(Raster2>Raster3),2,Con((Raster3>Raster1)&(Raster3>Raster2),3,0))) <- let step2 output = MaxRaster
  3. Step 3. Use Combine raster tool to compine rasters MaxValue and MaxRaster.

That should give you the maximum values with the rasters they came from in another column. 1 = from raster1, 2 = from raster2, 3 = from raster3 and 0 if for some reason the values are equal. Note: This becomes a tedious solution if you have more than 3 rasters, if that is the case may be a python scripting solution with arcpy is better suited.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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