Snaps pour points to the cell of highest flow accumulation within a specified distance.
The Snap Pour Point tool is used to ensure the selection of points of high accumulated flow when delineating drainage basins using the Watershed tool. Snap Pour Point will search within a snap distance around the specified pour points for the cell of highest accumulated flow and move the pour point to that location.
If the input raster or feature pour point data is a point feature class, it will be converted to a raster internally for processing.
The output is an integer raster when the original pour point locations have been snapped to locations of higher accumulated flow.
The SnapPour method is used to ensure the selection of points of high accumulated flow when delineating drainage basins using the Watershed method. SnapPour will search within snapDistance around the specified pour points for the cell of highest accumulated flow and move the pour point to that location.
The accumulationRaster into ArcObjects is usually a Raster or RasterDataset that can be created using IHydrologyOp::FlowAccumulation.
The SourceDataset in ArcObjects can be a point feature or raster that represents point locations.
The output from the ArcObjects method is a temporary raster object. To save the raster permanently, use IRasterBandCollection::SaveAs method.
| Parameter | Explanation | Datatype |
|---|---|---|
| Input raster or feature pour point data (Required) |
Input pour point locations. For rasters, all cells that are not NoData 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) |
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 |
# 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()
| 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. |
' 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)