I want to clean up a calculated flow distance raster and need some ideas on how to do it.
As you can see in the picture, there are some pixels along streets and rivers (gray) that show connection (Red circle). These are the ones I want to get rid off.
Single pixels further away from the streets or rivers should not get deleted. Pixels close to streets/rivers within the bigger cluster areas should not be deleted.
Therefore, I am looking for a way to select pixels with only 2 neighbor pixels along the streets and delete them.
I'm thinking about a workflow like this:
- Select all Pixels close to the streets and rivers
- Calculate how many pixels are close to each pixel (White are NoData)
- Delete if pixel only touches 2 other pixels