TopoStream

需要 Spatial Analyst 许可。

摘要

定义了河流位置的线要素类列表。

说明

此对象用于地形 (topo) 转栅格工具。

所有线必须定向为指向下游。

要素类中应该仅包含单条线组成的河流。

要显示线段的方向,可将符号系统设置为在端点包括箭头。 从而使用显示线方向的箭头符号绘制线的各个部分。

语法

 TopoStream (inFeatures)
参数说明数据类型
inFeatures
[inFeature,...]

输入要素数据集。

String

属性

属性说明数据类型
inFeatures
(可读写)

输入要素数据集。

String

代码示例

TopoStream 示例 1(Python 窗口)

演示如何创建 TopoStream 类以及如何在 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")
TopoStream 示例 2(独立脚本)

使用 TopoStream 类作为输入参数之一,通过 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"])
# Execute TopoToRaster
outTopoToRaster = TopoToRaster([myTopoPtElev, myTopoContour, myTopoBoundary, myTopoLake, myTopoSink, myTopoStream])
# Save the output 
outTopoToRaster.save("C:/sapyexamples/output/ttraster2")

相关主题