Basin (Spatial Analyst)

Summary

Creates a raster delineating all drainage basins.

Usage

Syntax

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

Raster Layer

Return Value

NameExplanationData Type
out_raster

The output raster that delineates the drainage basins.

It will be of integer type.

Raster

Code Sample

Basin example 1 (Python window)

This example determines the drainage basins of an input flow direction GRID raster.

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

This example determines the drainage basins of an input flow direction GRID raster.

# Name: Basin_Ex_02.py
# Description: Creates a raster delineating all drainage basins.
# Requirements: Spatial Analyst Extension
# Author: ESRI

# 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"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute FlowDirection
outBasin = Basin(inFlowDirectionRaster)

# Save the output 
outBasin.save("C:/sapyexamples/output/outbasin02")

Environments

Related Topics

Licensing Information

ArcView: Requires Spatial Analyst
ArcEditor: Requires Spatial Analyst
ArcInfo: Requires Spatial Analyst

6/29/2011