Skip To Content



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


Watershed tool illustration


  • The value of each watershed will be taken from the value of the source in the input raster or feature pour point data. When the pour point is a raster dataset, the cell values will be used. When the pour point is a point feature dataset, the values will come from the specified field.

  • The Watershed tool only supports a D8 input flow direction raster. D8 flow directions can be created using the Flow Direction tool, run with default flow direction type D8.

  • When specifying the input pour point locations as feature data, the default field will be the first available valid field. If no valid fields exist, the ObjectID field (for example, OID or FID) will be the default.


Watershed_ra (inputFlowDirectionRaster, inPourPointRasterOrFeatures, outputName, {pourPointField})
ParameterExplanationData Type

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

Raster Layer; Image Service; String

The input pour point locations.

Raster Layer; Feature Layer; Image Service; Feature Service; String

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.


Field used to assign values to the pour point locations.


Derived Output

NameExplanationData Type

The output raster.

Raster Layer

Code sample

Watershed example 1 (Python window)

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

import arcpy
Watershed example 2 (stand-alone script)

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

# Name:
# 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)

Licensing information

  • Basic: Requires ArcGIS Image Server
  • Standard: Requires ArcGIS Image Server
  • Advanced: Requires ArcGIS Image Server

Related topics