# Changing the value of a raster cell depending on how many cells in the neighborhood have a certain value

I have an issue that feels like it should be simple but I cannot for the life of me figure it out.

In the image below I have calculated a viewshed for the selected point. What I need to do is assign a value to the raster cell below the point, depending on how many cells that can be seen from that point.

(x if <50% of cells within the small radius can be seen; y if >50% of cells within the small radius but <50% of cells within the outer radius can be seen; z if >50% of cells within the outer radius can be seen)

In short, I need to calculate viewshed from a raster cell rather than a point and simultaneously assign a value to the cell. This would ideally be done through some form of moving window analysis as I need to do this for pretty much every cell in the raster. It feels like it shouldn't be this hard so if there's an obvious solution, feel free to call me an idiot and give me the answer! :)

• Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works Feb 28, 2023 at 17:03

``````Con(FocalStatistics("Viewshe_nh_61_2m", NbrCircle(small_radius_value, small_radius_units),"MEAN") < 0.5, value_x_if_true, Con(FocalStatistics("Viewshe_nh_61_2m", NbrCircle(large_radius_value, large_radius_units),"MEAN") < 0.5, y_value_if_true, z_value_if_false))