# Identify the top 10% of raster cells

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?

## 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? – the_chimp Mar 4 '16 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. – radouxju Mar 4 '16 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? – AndrewLebron Nov 7 '18 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). – radouxju Nov 7 '18 at 7:05