Select to view content in your preferred language

Raster Calculator Con, Focal statistics, MAJORITY not working

1250
3
12-24-2020 03:30 AM
Labels (2)
LeendertBorgers
Emerging Contributor

Dear arcgis community,

currently I'm working on my thesis. I have a raster with a certain amount of noData that needs to be filled. I'm working with the following raster calculator equation: 

LeendertBorgers_0-1608809026973.png

This works great if I use MEAN or MAXIMUM but I want MAJORITY. but if i use Majority it starts running the model but it gets stuck on 1% and it won't progress. No error message and I can't stop it or anything and I have to restart my arcGIS Pro. the raster is integer and if I only use the focal statistic tool it does not crash. 

3 Replies
DanPatterson
MVP Esteemed Contributor

Did you try to specify NODATA in FocalStatistics?

Con(IsNull("%g%"),
    FocalStatistics("%g%",
        NbrRectangle(100, 100, "CELL"),
        "MAJORITY",
        "NODATA"),
        "%g%")

... sort of retired...
LeendertBorgers
Emerging Contributor

the tool works that way but it doesn't do what I want it to do. I want to fill the NoData cells with data from surrounding cells and majority would be the best option. This way it keeps all the NoData cells. 

Mean and Maximum work but Majority makes my arcGIS Pro unresponsive and I have to shut it down through windows task manager.

DanPatterson
MVP Esteemed Contributor

I would report it since I think it is getting into an endless loop trying to count for a majority which ignoring nodata, whereas the mean and other statistics based options would simply return "nan" aka None


... sort of retired...