Equal majority of raster with priority

634
2
02-18-2021 05:11 AM
Labels (1)
Los
by
New Contributor

Hello all!

I am currently working on making a map of 2.5m pixel cells to 25m pixel cells where the pixels are land classes. The 25x25m output is made with block statistics (majority rule) to get the pixel value for the 25m cells of the majority of 2.5m input cells. However, equal cells (for example 50 grassland pixels and 50 water pixels of the input) is becoming NoData since there is no majority.

My question is now: Is there a possibility to assign a priority rule to some tool or within raster calculator that chooses which of the equal input cells is chosen as output. For example, grassland has a higher priority than water pixels. So if it is 50/50 it should make an output of Grassland cell. But woods has for example a higher priority than grassland so than woods should be the output. However, if there are 40 grassland pixels, 40 water pixels and 20 wood pixels, the result should be grassland.

I tried many things but it is a difficult puzzle.

I hope you can help me! Thanks in advance.

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

Have you tried a Focal Statistics (majority) first then Block Statistics (Majority ) of the resultant?

Alternatives...

Is there anything that you can observe pattern wise that would suggest a different neighbor shape or weight that might help?

Mask out one class (eg water and get the majority (of grassland & wood).  Then repeat with one of the others masked?  Compare the results or combine into a new class

 


... sort of retired...
0 Kudos
JayantaPoddar
MVP Esteemed Contributor

A workaround I can think of (but not tried)... And could be time consuming, esp. step 3

1. Create Fishnet (polygon) with each grid height X width as 25mX25m for the extent of the desired raster.

2. Execute Zonal Statistics (Majority). When there is a tie for the majority value in a zone, the output for all cell locations in the zone is assigned the lowest of the tied values.

3. Execute Polygon to Raster keeping 25m as cell size

*Please ensure to keep same coordinate system (Projected) throughout.



Think Location
0 Kudos