Basin (Spatial Analyst)

License Level:BasicStandardAdvanced

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

# 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

ArcGIS for Desktop Basic: Requires Spatial Analyst
ArcGIS for Desktop Standard: Requires Spatial Analyst
ArcGIS for Desktop Advanced: Requires Spatial Analyst
4/10/2014