ArcGIS Tutorial: Watershed

Source: Internet
Author: User

  Summary

Determines the catchment area above a set of cells in a raster.

  Usage

· The values for each watershed are taken from the source values in the input raster or from the feature pour point data. If the pour point is a raster dataset, the cell value is used. If the pour point is a point feature dataset, the value is obtained from the specified field.

· If you pre-use the Snap pour Point tool to position the pour point to a cell with a large accumulated flow, you will get better results.

· When you specify an input pour point location as the feature data, the default field will be the first available valid field. If no valid field exists, the ObjectID field (such as OID or FID) will be the default field.

  Grammar

Watershed (In_flow_direction_raster, In_pour_point_data, {Pour_point_field})

  Code instance

  Watershed Example 1 (Python window)

This example determines the catchment area for the selected pour point position in the flow to grid grid.

Import arcpy

From arcpy Import env

From ARCPY.SA Import *

Env.workspace = "C:/sapyexamples/data"

outwatershed = Watershed ("Flowdir", "Pourpoint")

Outwatershed.save ("C:/sapyexamples/output/outwtrshd01")

 Watershed Example 2 (stand-alone script)

This example determines the catchment area for the selected pour point position in the flow to grid raster and outputs the watershed as a TIFF raster.

# Name:Watershed_Ex_02.py

# Description:determines The contributing area above a set of cells in a

# Raster.

# 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

Inflowdirection = "Flowdir"

Inpourpointdata = "Pourpoint"

Inpourpointfield = "VALUE"

# Check out the ArcGIS Spatial Analyst extension License

arcpy. Checkoutextension ("Spatial")

# Execute Watershed

outwatershed = Watershed (inflowdirection, Inpourpointdata, Inpourpointfield)

# Save the output

Outwatershed.save ("C:/sapyexamples/output/outwtrshd02.tif")

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

ArcGIS Tutorial: Watershed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.