Basin

Creates a raster delineating all drainage basins.

Learn more about how Basin works


Usage tips

Command line and Scripting

Map Algebra

ArcObjects

Syntax

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

The input raster that shows 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 delineates the drainage basins.

Raster Dataset
Data types for geoprocessing tool parameters

Script Example

# Basin_sample.py
# Description: 
#   Creates a raster delineating all drainage basins.
# 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/basin"    

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

    # Process: Basin
    gp.Basin_sa(InFlowDirectionRaster, OutRaster)

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

Map Algebra syntax

Basin(<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

basin(flowdir)					
basin(flowdirection(elev))

ArcObjects syntax

IHydrologyOp::Basin (directionRaster As IGeoDataset) As IGeoDataset

Parameter Explanation
directionRaster An input Raster, RasterDataset, RasterBand, or RasterDescriptor showing the direction of flow out of each cell. This Raster 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 raster object
Dim pDirectionDataset As IGeoDataset

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

' Declare the output raster
Dim pOutputRaster As IGeoDataset

' Calls the method
Set pOutputRaster = pHydrologyOp.Basin (pDirectionDataset)

See Also

  • Fill
  • Sink
  • Flow Accumulation
  • An overview of the Hydrology tools