Snap Pour Point (Spatial Analyst)

Summary

Snaps pour points to the cell of highest flow accumulation within a specified distance.

Usage

Syntax

SnapPourPoint (in_pour_point_data, in_accumulation_raster, snap_distance, {pour_point_field})
ParameterExplanationData Type
in_pour_point_data

The input pour point locations that are to be snapped.

For rasters, all cells that are not NoData (i.e., have a value) will be considered pour points and will be snapped.

For point datasets, specifies the locations of cells that will be snapped.

Raster Layer
in_accumulation_raster

The input flow accumulation raster.

This can be created with the Flow Accumulation tool.

Raster Layer
snap_distance

Maximum distance, in map units, to search for a cell of higher accumulated flow.

Double
pour_point_field
(Optional)

Field used to assign values to the pour point locations.

If the pour point dataset is a raster, use Value.

If the pour point dataset is a feature, use a numeric field. If the field contains floating-point values, they will be truncated into integers.

Field

Return Value

NameExplanationData Type
out_raster

The output pour point integer raster where the original pour point locations have been snapped to locations of higher accumulated flow.

Raster

Code Sample

SnapPourPoint example 1 (Python window)

This example snaps pour points to the cell of highest flow accumulation within a specified distance.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outSnapPour = SnapPourPoint("pourpoint", "flowaccumulation.img", 5,"VALUE") 
outSnapPour.save("c:/sapyexamples/output/outsnpprpnt01")
SnapPourPoint example 2 (stand-alone script)

This example snaps pour points to the cell of highest flow accumulation within a specified distance.

# Name: SnapPourPoints_Ex_02.py
# Description: Snaps pour points to the cell of highest 
#              flow accumulation within a specified distance.
# 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
inPourPoint = "pourpoint"
inFlowAccum = "flowaccumulation.img"
tolerance = 5
pourField = "VALUE"

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

# Execute SnapPourPoints
outSnapPour = SnapPourPoint(inPourPoint, inFlowAccum, tolerance, 
                            pourField) 

# Save the output 
outSnapPour.save("c:/sapyexamples/output/outsnpprpnt02")

Environments

Related Topics

Licensing Information

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

6/29/2011