Sink

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

Learn more about how Sink works


Usage tips

Command line and Scripting

Map Algebra

ArcObjects

Syntax

Sink_sa (in_flow_direction_raster, out_raster)
Parameter Explanation Datatype
Input flow direction raster (Required)

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

This is created with the Flow Direction function.

Composite Geodataset
Output raster (Required)

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

Raster Dataset
Data types for geoprocessing tool parameters

Script Example

# Sink_sample.py
# Description: 
#   Creates a raster identifying all sinks, or areas of internal drainage.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InFlowDirectionRaster = "C:/data/flowdir"
    OutRaster = "C:/data/sink"

    # Check out Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: Sink
    gp.Sink_sa(InFlowDirectionRaster, OutRaster)

 except:
    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

Map Algebra syntax

Sink(<dir_grid>)

Parameter Explanation
<dir_grid> A raster showing direction of flow out of each cell. This can be created using the FlowDirection function.

Map Algebra example

sink(flow_dir)
sink(flowdirection(elev_grid))

ArcObjects syntax

IHydrologyOp::Sink (directionRaster As IGeoDataset) As IGeoDataset

Parameter Explanation
geoDataset An input Raster, RasterDataset, RasterBand, or RasterDescriptor showing the direction of flow out of each cell. This can be created using the IHydrologyOp::FlowDirection method.

ArcObjects example

' Create the RasterHydrologyOp object
Dim pHydrologyOp As IHydrologyOp
Set pHydrologyOp = New RasterHydrologyOp

' Declare the input direction raster object
Dim pDirection As IGeoDataset

' Calls function to open a raster dataset from disk
Set pDirection = OpenRasterDataset("D:\SpatialData", "direction")

' Declare the output raster object
Dim pOutputRaster As IGeoDataset

' Calls the method
Set pOutputRaster = pHydrologyOp.Sink(pDirection)

See Also

  • Basin
  • Watershed
  • Stream Link
  • An overview of the Hydrology tools