Skip To Content

Sink

Available with Spatial Analyst license.

Summary

Creates a raster identifying all sinks or areas of internal drainage.

Learn more about how Sink works

Usage

  • A sink is a cell or set of spatially connected cells whose flow direction cannot be assigned one of the eight valid values in a flow direction raster. This can occur when all neighboring cells are higher than the processing cell or when two cells flow into each other, creating a two-cell loop.

  • The Sink 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.

  • The output of the Sink tool is an integer raster with each sink being assigned a unique value. Sinks are numbered between one and the number of sinks.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Syntax

Sink (in_flow_direction_raster)
ParameterExplanationData Type
in_flow_direction_raster

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

The flow direction raster can be created using the Flow Direction tool, run using the default flow direction type D8.

Raster Layer

Return Value

NameExplanationData Type
out_raster

The output raster that shows all the sinks (areas of internal drainage) on the input surface.

This output is of integer type.

Raster

Code sample

Sink example 1 (Python window)

This example identifies the sinks on an input flow direction Grid raster.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outSink = Sink("flowdir")
outSink.save("C:/sapyexamples/output/outsink01")
Sink example 2 (stand-alone script)

This example identifies the sinks on an input flow direction Grid raster.

# Name: Sink_Ex_02.py
# Description: Creates a raster identifying all sinks or areas of internal drainage.
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inFlowDirectionRaster = "flowdir"

# Execute FlowDirection
outSink = Sink(inFlowDirectionRaster)

# Save the output 
outSink.save("C:/sapyexamples/output/outsink02")

Licensing information

  • ArcGIS Desktop Basic: Requires Spatial Analyst
  • ArcGIS Desktop Standard: Requires Spatial Analyst
  • ArcGIS Desktop Advanced: Requires Spatial Analyst

Related topics