# Identifying top 10% of raster cells using ArcGIS Desktop

I have a raster with different risk values for a hazard.

How can I identify the top x% (eg. 10%) of the raster cells with the highest values within ArcGIS Desktop?

• find out what 10% is numerically and then use Extract by Attributes resources.arcgis.com/en/help/main/10.1/index.html#//… or SetNull resources.arcgis.com/en/help/main/10.1/index.html#//… to create a raster to highlight these cells. How do you define 10% though? is it the top value representing 10% of the raster or 10% of the range? Commented Mar 3, 2016 at 5:44
• Thanks, I will try that. I mean 10% of the range. So If I have a raster with 200 cells with values from 1 to 200, as result I would like to have the cells with values greater than 180. Commented Mar 3, 2016 at 5:52

## 1 Answer

From your comment I understand that you are not looking for percentile but a given percentage of your range. You can use the raster calculator

``````Con("raster" >= (0.9 * ("raster".maximum - "raster".minimum) + "raster".minimum), 1)
``````

of course 0.9 could be replaced by any value (this is an example with 10%). Note that the results will be a raster with 1 or Nodata, but you can also set a value instead of NoData if you need.

• Can you explain in more detail the used formula for the raster calculator? Why is 0.9 multiplied with the maximum-minimum value of the raster and then added with the minimu values? Commented Mar 4, 2016 at 6:56
• max - min is the range of value. So if you take 0.9 (= 90%) of the range value you get the top 10 %. But then you need to add the minimum in order to compare data with the original value. For instance, if your values are between 200 and 300, then your range is 300-200=100 and the top 10% are above 200 + 0.9*100 = 290. as a special case, you can assume that 0 is your minimum value, then the equation simplifies into 0.9 * max. Commented Mar 4, 2016 at 9:06
• This is amazing. Not OP but thanks a lot. I want to do this for many rasters in a gdb. Wondering if this is possible. I don't see a way to put the result of a raster iteration into map algebra. Is there any work around for this? Commented Nov 7, 2018 at 3:08
• I've never tried with model builder, but this is possible in a Python script. I suggest that you post a new question because writing a Python script in a comment is not possible (and answering in comment is not a good practice anyway because it is not findable for others). Commented Nov 7, 2018 at 7:05