I've got a predicted stream network raster with cells values 0 (not a stream) and 1 (is a stream). My end goal is to create a network of connected polylines, but unfortunately there are some areas that are disconnected that we want to include in the final file, and some we do not - we have decided to get rid of any segments disconnected from the larger network by more than 2 cells.
Therefore, I would only like to keep the cells with value 1 that are either 1. connected to the larger network or 2. within 2 cells (~40ft) of this main network. The areas circled in green below are what we're hoping to maintain, while removing the areas circled in red.
I have tried using Spatial Analyst --> Region Group then reclassification (using a cutoff of count = 7) to remove the "orhpans" as we call we them, but that also gets rid of some areas that shouldn’t be cut, like a segment that’s short but only disconnected by 1 or 2 cells. See image below - areas in red should be maintained but are not.
I understand why using the cutoff of 7 wouldn't necessarily work, as it would cut out small segments that are disconnected by 1 or 2 cells. I'm not sure what approach I SHOULD use, however.