Remove short streams

This tool can be used to remove stream links in a stream network that are shorter than a user-specified length. The user must also specify the name of a stream network raster image and a D8-derived flow pointer (i.e. flow direction) image. The flow pointer image is used to navigate through the stream network from channel heads towards outlets. The output image will have a NoData background value for all non-stream values.

See Also:

Scripting:

The following is an example of a Python script that uses this tool:

wd = pluginHost.getWorkingDirectory()
streamsFile = wd + "streams.dep"
pointerFile = wd + "D8 pointer.dep"
outputFile = wd + "output.dep"
minStreamLength = "50"
args = [streamsFile, pointerFile, outputFile, minStreamLength]
pluginHost.runPlugin("RemoveShortStreams", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def streamsFile = wd + "streams.dep"
def pointerFile = wd + "D8 pointer.dep"
def outputFile = wd + "output.dep"
def minStreamLength = "50"
String[] args = [streamsFile, pointerFile, outputFile, minStreamLength]
pluginHost.runPlugin("RemoveShortStreams", args, false)

Credits: