Watershed (Raster Analysis)

Titleā€ƒ Watershed (Raster Analysis)

Summary

Determines the contributing area above a set of cells in a raster.


Illustration

Watershed tool illustration Watershed tool illustration

Usage


Syntax

Parameter Explanation
inputFlowDirectionRaster

The input raster that shows the direction of flow out of each cell.

inPourPointRasterOrFeatures

The input pour point locations.

outputName

The name of the output watershed raster service.

The default name is based on the tool name and the input layer name. If the layer already exists, you will be prompted to provide another name.

pourPointField (Optional)

Field used to assign values to the pour point locations.

Code Samples

Watershed example 1 (Python window)

This example determines the contributing area for selected pour point locations on a flow direction raster.


import arcpy
arcpy.Watershed_ra("https://myserver/rest/services/flowdir/ImageServer","https://myserver/rest/services/streamlink/ImageServer","outWatershed1")

                    

Watershed example 2 (stand-alone script)

This example determines the contributing area for selected pour point locations on a flow direction raster.


#---------------------------------------------------------------------------
# Name: Watershed_example02.py
# Requirements: ArcGIS Image Server

# Import system modules
import arcpy

# Set local variables
inFlowDirection = "https://myserver/rest/services/flowdir/ImageServer"
inPourPoint = "https://myserver/rest/services/streamlink/ImageServer"
outputWatershed = "outWatershed2"

# Execute Watershed raster analysis tool
arcpy.Watershed_ra(inFlowDirection, inPourPoint, outputWatershed)
                    

Tags

Credits

Use limitations