需要 Spatial Analyst 许可。
摘要
定义点要素类列表,这些点要素类表示已知地形凹陷的位置和量级以及标识其高程值的字段。
讨论
此对象用于地形 (topo) 转栅格工具。
地形转栅格工具不会尝试从分析中移除明显识别为汇点的任何点。所用字段应该能够存储合法汇点的高程。如果选择了 NONE,将仅使用汇点的位置。
语法
TopoSink (inFeatures)
参数 | 说明 | 数据类型 |
inFeatures [[inFeature, {field}],...] | 输入点要素数据集。 或者,可以提供存储高程值的字段名称以用于输入点。所用 field 应能存储合法汇点高程。如果选择了 NONE,将仅使用凹陷的位置。 | List |
属性
属性 | 说明 | 数据类型 |
inFeatures (读写) |
用于属性的输入要素数据集和字段。 | List |
代码实例
TopoSink 示例 1(Python 窗口)
演示如何创建 TopoSink 类以及如何在 Python 窗口的 TopoToRaster 工具中使用该类。
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myTopoPtElev = TopoPointElevation([["spots.shp", "spot_meter"], ["spots2.shp", "elev"]])
myTopoContour = TopoContour([["contours.shp", "spot_meter"]])
myTopoBoundary = TopoBoundary(["boundary.shp"])
myTopoLake = TopoLake(["lakes.shp"])
myTopoSink = TopoSink([["sink1.shp", "elevation"], ["sink2.shp", "NONE"]])
myTopoStream = TopoStream(["streams.shp"])
myTopoCliff = TopoCliff(["cliff.shp"])
myTopoCoast = TopoCoast(["coast.shp"])
myTopoExclusion = TopoExclusion(["ignore.shp"])
outTopoToRaster1 = TopoToRaster([myTopoPtElev, myTopoContour, myTopoBoundary, myTopoLake, myTopoSink, myTopoStream, myTopoCliff, myTopoCoast, myTopoExclusion])
outTopoToRaster1.save("C:/sapyexamples/output/ttraster1")
TopoSink 示例 2(独立脚本)
使用 TopoSink 类作为其中一个输入参数,通过 TopoToRaster 插入一个表面。
# Name: TopoBoundary_Ex_02.py
# Description: Execute TopoToRaster using all the supported objects.
# 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"
# Create all the supported Objects
myTopoPtElev = TopoPointElevation([["spots.shp", "spot_meter"], ["spots2.shp", "elev"]])
myTopoContour = TopoContour([["contours.shp", "spot_meter"]])
myTopoBoundary = TopoBoundary(["boundary.shp"])
myTopoLake = TopoLake(["lakes.shp"])
myTopoSink = TopoSink([["sink1.shp", "elevation"], ["sink2.shp", "NONE"]])
myTopoStream = TopoStream(["streams.shp"])
myTopoCliff = TopoCliff(["cliff.shp"])
myTopoCoast = TopoCoast(["coast.shp"])
myTopoExclusion = TopoExclusion(["ignore.shp"])
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute TopoToRaster
outTopoToRaster = TopoToRaster([myTopoPtElev, myTopoContour, myTopoBoundary, myTopoLake, myTopoSink, myTopoStream, myTopoCliff, myTopoCoast, myTopoExclusion])
# Save the output
outTopoToRaster.save("C:/sapyexamples/output/ttraster2")