This tool can be used to measure the distance of any location along a stream to the watershed outlet, i.e. the outlet node of the stream network. The user must specify the names of a D8 pointer image (flow direction) and a streams raster image. Stream cells are designated in the streams image as all positive, nonzero values. Thus all non-stream or background grid cells are commonly assigned either zeros or NoData values. The pointer image is used to traverse the stream network and should only be created using the D8 flow algorithm. The streams image should be derived using a flow accumulation based stream network extraction algorithm, also based on the D8 flow algorithm. The output image can optionally set background (non-stream) grid cells to zero or NoData.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
pointerFile = wd + "D8 pointer.dep"
streams = wd + "streams.dep"
outputFile = wd + "output.dep"
nodataBackground = "false"
args = [pointerFile, streams, outputFile, nodataBackground]
pluginHost.runPlugin("DistanceToOutlet", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def pointerFile = wd + "D8 pointer.dep"
def streams = wd + "stream.dep"
def outputFile = wd + "output.dep"
def nodataBackground = "true"
String[] args = [pointerFile, streams, outputFile, nodataBackground]
pluginHost.runPlugin("DistanceToOutlet", args, false)