I am working with a bunch of shapefiles. Each shapefile consisting in rectangles with an integer attribute representing the strength of a signal. I serve these vector files as overlays on a base map, applying different colors based on the integer attribute (like a heat map, or a coverage map).
I have a problem with data: it contains "holes". The term "hole" here can be easily explained with an image:
That is a screenshot of a portion of my data loaded in QGIS. I've applied a simple style: just use orange for a range of values between X and Y. Otherwise, no color applied.
The white squares surrounded by blue circles are probably measurement errors. Each square represent 250m in the real world. It doesn't really make sense getting a measure of X in a point (i.e.: -55 dbM) and 250 meters beyond a value way lower (or higher), out of the represented range.
So, I'm basically looking for an algorithm to "detect" this pattern: One vector containing a integer value of -10000 (the "anomaly") but surrounded by vectors containing "normal" and coherent values. I want to avoid a simple dumb loop, checking all the vectors based on their position. I manage several GBs of data, and this can take forever.
Is there any known algorithm to detect this kind of problem in vectorial files?
UPDATE: There are some suggestions in comments. But I missed one important part: the space that surrounds the shapefile (the big white space around the shapefile) is considered "water", and a value of "no coverage" is allowed. So, I just need to get rid of the small holes (in blue in the image), but keep the surrounding space unchanged. That makes things more difficult...
Many thanks in advance