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.
Solved! Go to Solution.
Correct, the Majority option will use a 4 by 4 moving filter window to process each pixel. This usually means the 16 nearest pixels.
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.
Here is a zoomed out extent. The black outlines are the 30-meter grid cells.
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.
I did not even know this tool existed. thank you!!
Good luck with your project!
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.
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.
Correct, the Majority option will use a 4 by 4 moving filter window to process each pixel. This usually means the 16 nearest pixels.
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.