『公告』 预祝您龙年大吉,万事如意, 过节期间, 大家如需数据服务,请拨打400 或直接添加客服微信,再祝大家龙年,心想事成。
关注我们 新浪 腾讯

ArcGIS教程:捕捉倾泻点

ArcGIS教程:捕捉倾泻点
捕捉倾泻点工具用于确保在使用分水岭工具描绘流域盆地时选择累积流量大的点。捕捉倾泻点将在指定倾泻点周围的捕捉距离范围内搜索累积流量最大的像元,然后将倾泻点移动到该位置。

摘要

    将倾泻点捕捉到指定范围内累积流量最大的像元。

用法

·      捕捉倾泻点工具用于确保在使用分水岭工具描绘流域盆地时选择累积流量大的点。捕捉倾泻点将在指定倾泻点周围的捕捉距离范围内搜索累积流量最大的像元,然后将倾泻点移动到该位置。

·      如果输入倾泻点数据是点要素类,则会在内部将其转换为栅格数据以进行处理。

·      在将原始倾泻点位置捕捉到累积流量更大的位置后,输出为整型栅格。

·      如果只有一个输入倾泻点位置,则输出的范围是蓄积栅格数据的范围。如果有多个倾泻点位置,则输出的范围由输出范围环境中的设置决定。

·      当指定输入倾泻点位置作为要素数据时,默认字段将为首个可用的有效字段。如果不存在有效字段,则 ObjectID 字段(如 OID FID)将为默认字段。

语法

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

参数

说明

数据类型

in_pour_point_data

将要捕捉的输入倾泻点位置。

对于栅格数据输入,所有不是 NoData(即,具有值)的像元都将被视为倾泻点,并会被捕捉。

对于点要素输入,这指定了将被捕捉的像元的位置。

Raster Layer | Feature Layer

in_accumulation_raster

输入流量累积栅格。

这可使用流量工具进行创建。

Raster Layer

snap_distance

搜索累积流量更大的像元时所使用的最大距离范围(以地图单位表示)。

Double

pour_point_field

(可选)

用于为倾泻点位置赋值的字段。

如果倾泻点数据集为栅格,则使用 Value

如果倾泻点数据集为要素,则使用数值字段。如果该字段包含浮点型值,它们将被截断为整型。

Field

返回值

名称

说明

数据类型

out_raster

在将原始倾泻点位置捕捉到累积流量更大的位置后产生的输出倾泻点整型栅格。

Raster

代码实例

    SnapPourPoint 示例 1Python 窗口)

    此示例将倾泻点捕捉到指定距离范围内累积流量最大的像元。

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 示例 2(独立脚本)

    此示例将倾泻点捕捉到指定距离范围内累积流量最大的像元。

# Name: SnapPourPoints_Ex_02.py

# Description: Snaps pour points to the cell of highest

#              flow accumulation within a specified distance.

# 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

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")

      京ICP备2025132830号-1 京公网安备 号