I am calculating how much solar radiation each rooftop in the neighborhood receives throughout the year and which buildings are suitable to install the solar panels based on different criteria. One of these criteria is that if a building has less than 30 square meters of suitable roof surface, it is generally not suitable for solar panel installation. However, some buildings have linear pixels or scattered pixels which theoretically, meet the criterion but practically do not. (see attached) Can you help me to delete these pixels or avoid such a situation? As you can see the 3 buildings meet the criterion but the one on the right and lift practically they are not suitable for solar panel installation. enter image description here

1 Answer 1


If you have spatial analyst, you could set all the NoData in your raster to a value of 0, and then run Focal Statistics with whatever neighborhood and stat type gives you the desired result.

  • Thank you Brennan but could you explain more please. Commented Mar 20, 2023 at 15:16
  • 1
    You can use Raster calculator to convert NoData to 0 Con(IsNull("ras"), 0, "ras"). But the approach depends on your data. Is any raster value considered suitable, or is there a threshold? Do you have access to the Spatial Analyst extension? Also check out the ESRI help on Focal Statistics.
    – Brennan
    Commented Mar 20, 2023 at 15:40
  • Yes, I have access to Spatial Analyst. it is not about the pixel value but the distribution of the pixels: linear such as the pixels within the buildings on the left and the right or dense such as the pixels within the buildings in the middle. Commented Mar 20, 2023 at 16:03
  • 2
    Copy your raster and reclassify it so NoData = 0, and all other values = 1. Use Focal Statistics with a NbrRectangle(4,4,"CELL") neighborhood and a Majority statistics type. The result should screen out linear features. Adjust the neighborhood parameter in Focal Statistics as necessary to get the desired result.
    – Brennan
    Commented Mar 20, 2023 at 16:12
  • Thank you Brennan. It worked :-) Commented Mar 21, 2023 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.