Snap Pour Point

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


Usage tips

Command line and Scripting

ArcObjects

Syntax

SnapPourPoint_sa (in_pour_point_data, in_accumulation_raster, out_raster, snap_distance, pour_point_field)
Parameter Explanation Datatype
Input raster or feature pour point data (Required)

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.

Composite Geodataset
Input accumulation raster (Required)

The input flow accumulation raster.

This can be created with the Flow Accumulation function.

Composite Geodataset
Output raster (Required)

The raster to be created.

Raster Dataset
Snap distance (Required)

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 in_pour_point_data is a raster, use Value.

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

Field
Data types for geoprocessing tool parameters

Script Example

# SnapPourPoint_sample.py
# Description:
#   Snaps pour points to the cell of highest flow accumulation 
#   within a specified distance.# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InPourPointRaster = "C:/data/pourpoint"
    InAccumulationRaster = "C:/data/flowaccu"
    OutRaster = "C:/data/final1"
    InSnapDistance = "80"

    # Check out Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: SnapPourPoint
    gp.SnapPourPoint_sa(InPourPointRaster, InAccumulationRaster, OutRaster, InSnapDistance)

except:
    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

Map Algebra syntax

See SnapPour


ArcObjects syntax

IHydrologyOp::SnapPourPoint (sourceDataset As IGeoDataset, accumulationRaster As IGeoDataset, snapDistance As Double) As IGeoDataset

Parameter Explanation
sourceDataset An input Raster, RasterDataset, RasterBand, RasterDescriptor, FeatureClass, or FeatureClassDescriptor of locations to be used as pour points. If a raster, cells that are not NoData will be considered pour points and will be snapped.
accumulationRaster A raster of accumulated flow created with the IHydrology::FlowAccumulation method.
snapDistance The maximum distance, in map units, to search for a cell of higher accumulated flow. A common snap distance is zero, the same as if SnapPourPoint was not used.

ArcObjects example

' Create the RasterHydrologyOp object
Dim pHydrologyOp As IHydrologyOp
Set pHydrologyOp = New RasterHydrologyOp

' Declare the input source raster object	
Dim pSource As IGeoDataset

' Calls function to open a raster dataset from disk
Set pSource = OpenRasterDataset ("D:\SpatialData", "source")

' Declare the input accumulation raster object
Dim pAccum As IGeoDataset

' Calls function to open a raster dataset from disk
Set pAccum = OpenRasterDataset ("D:\SpatialData", "accum")

' Declare the output raster object
Dim pOutputRaster As IGeoDataset

' Calls the method	
Set pOutputRaster = pHydrologyOp.SnapPourPoint (pSource, pAccum, 10)

See Also

  • Flow Accumulation
  • Flow Direction
  • Flow Length
  • An overview of the Hydrology tools