ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Basin

Available with Spatial Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates a raster delineating all drainage basins.

Usage

  • The drainage basins are delineated within the analysis window by identifying ridge lines between basins. The input flow direction raster is analyzed to find all sets of connected cells that belong to the same drainage basin. The drainage basins are created by locating the pour points at the edges of the analysis window (where water would pour out of the raster), as well as sinks, then identifying the contributing area above each pour point. This results in a raster of drainage basins.

  • To create the input D8 flow direction raster, the Flow Direction tool must be run using the default flow direction type D8.

    The best results will be obtained if when the input D8 Flow Direction raster was created, the Force all edge cells to flow outward option (FORCE in Python) was enabled.

  • All cells in the raster will belong to a basin, even if that basin is only one cell.

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

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.

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

Raster Layer

Return Value

NameExplanationData Type
out_raster

The output raster that delineates the drainage basins.

This output is 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

  • Auto Commit
  • Cell Size
  • Cell Size Projection Method
  • Compression
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • Output CONFIG Keyword
  • Output Coordinate System
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing information

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

Related topics

  • An overview of the Hydrology toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal