How to count number of overlapped pixels?

3718
9
04-28-2017 03:19 AM
PoojaPandey1
New Contributor III

 I wish to overlap two layer and count the number of pixels which are overlapping and the leftovers one. Please help me with the same.

Tags (2)
0 Kudos
9 Replies
PoojaPandey1
New Contributor III

I have two different raster having flooded pixels as value 1 and non flooded as 0. I wish to count the overlapped pixels.

MervynLotter
Occasional Contributor III

Try the Cell Statistics geoprocessing tool.

https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/cell-statistics.htm

NeilAyres
MVP Alum

And you can just add the 2 rasters together, then open the attribute table to see pixels counts of the values 0, 1, 2

curtvprice
MVP Esteemed Contributor

If the cell sizes are the same, try this in Raster Calculator:

Con(("flood01" + "flood02") == 2, 1)

The output raster attribute table will have one row and its Count field will have the number of cells.

In case the cell sizes are different you could do this with area, using Raster Calculator:

ZonalGeometry(Con(("flood01" + "flood02") == 2, 1), "VALUE", "AREA")

All overlapping cells will have the value of the total area overlapped.

AbdullahAnter
Occasional Contributor III

If you want to extract the overlap area and count the pixels, you can use any tool that depend on overlap raster ,such as

Cut Fill. The output of this tool will be the overlap area. we know you don't need cut and fill values, but if you open attribute table and count the pixel you will got the pixels count of overlap area.

Note you should to define the output pixel as original raster.

ModyBuchbinder
Esri Regular Contributor

What result do you want to get is the two rasters have different resolution?

I think the best way is to build mosaic (or two mosaics) and overlap the polygons (footprint or boundary).

You can use intersect to get the overlap AREA. Divide that area with the pixel size if you want the number of pixels.

Have Fun

PoojaPandey1
New Contributor III

Thank you all for your suggestions, I need to get the data from the overlapped pixels only. So I converted the raster layer into polygon and removed the portions not concerned using editor and then converted again to raster. Then added the two and got 2 for overlapped pixels and 1 for the non- flooded pixels.

0 Kudos