# Can someone explain how Majority Resample works for rasters?

1018
9
02-18-2020 11:44 AM
New Contributor III

Hello! I am trying to resample a 10-meter raster to a 30-meter raster. I need to use the majority value that falls within those 30-meter grid cells. However, as I am QA'ing the outputs, it looks like it does not always pick the majority value. Now I am confused on how the majority function actually works... In my example below, there are 5 cells with a value of 110, however after I use majority resample, it picks the 174 value instead? Why is that?

Explanation on how it decides what value to use would be invaluable to me! Thanks.

Tags (5)
1 Solution

Accepted Solutions
by
Esri Contributor

Correct, the Majority option will use a 4 by 4 moving filter window to process each pixel.  This usually means the 16 nearest pixels.

9 Replies
MVP Legendary Contributor

Can you widen your window to encompass the nearest 16?

Majority—Calculates pixel value using the majority pixel value in the 16 nearest pixels. NoData pixels will remain unchanged in the output raster dataset.

New Contributor III

Here is a zoomed out extent. The black outlines are the 30-meter grid cells.

MVP Frequent Contributor

Hi Michelle, rampling can become quite confusing. I believe the function you're using is focal, ie it calculates from a moving window across all of your cells.

I believe nlock statistics will suit your needs.

New Contributor III

I did not even know this tool existed. thank you!!

MVP Frequent Contributor

MVP Legendary Contributor

The nearest 16 would pick up the central block of 9, but I don't know the actual values of the purple cells and which ones it will pick up or what the cell weighting (if any) would be.

I will flag Steve Lynch‌ to see if he has any commentary.

New Contributor III

why does it use the nearest 16 cells? shouldn't it be dependent on the input and output cell sizes? I don't think I understand that reasoning.

by
Esri Contributor

Correct, the Majority option will use a 4 by 4 moving filter window to process each pixel.  This usually means the 16 nearest pixels.

New Contributor III

Thank you for the clarification! I did not realize Resample uses a moving filter window. It looks like I need to use Block Statistics as David Pike had mentioned above.