Can someone explain how Majority Resample works for rasters?

1373
9
Jump to solution
02-18-2020 11:44 AM
MichelleTanner
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. 

0 Kudos
1 Solution

Accepted Solutions
SimonWoo
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.  

View solution in original post

0 Kudos
9 Replies
DanPatterson_Retired
MVP Emeritus

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.

Resample function—ArcGIS Pro | Documentation 

0 Kudos
MichelleTanner
New Contributor III

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

0 Kudos
DavidPike
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.

How Block Statistics works—Help | ArcGIS for Desktop 

MichelleTanner
New Contributor III

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

0 Kudos
DavidPike
MVP Frequent Contributor

Good luck with your project!

0 Kudos
DanPatterson_Retired
MVP Emeritus

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.

MichelleTanner
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. 

0 Kudos
SimonWoo
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.  

0 Kudos
MichelleTanner
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. 

0 Kudos