VfTable (arcpy.sa)

摘要

使用垂直系数图定义垂直成本系数和垂直相对移动角度之间的关系,此垂直系数图确定表文件指定的垂直系数。

讨论

VfTable 对象用于 Spatial Analyst 工具路径距离路径距离分配路径距离回溯链接

垂直系数 (VF) 对象用于定义垂直成本系数和垂直相对移动角度 (VRMA) 之间的关系。

VF 用于定义从一个像元移至下一像元的垂直阻力。

VRMA 用于确定“起始”像元或处理像元与“终止”像元之间的坡度角。

在像元间移动始终存在相应的成本(尽管此成本可能非常小);因此,不得向表中输入任何负的垂直系数 (VF)。

在表中开头的所有负垂直系数都将被跳过,直至遇到第一个正系数为止。输入的首个正系数将定义最小垂直系数角。随后将继续读取后续表条目,直到再遇到负系数,或到达表的末尾。在达到这两个结束条件之前遇到的最后一个输入将定义最大垂直系数角。

语法

VfTable (inTable)
参数说明数据类型
inTable

The inTable is an ASCII file with two columns on each line. The first column identifies the VRMA in degrees, and the second, the VF. Each line specifies a point. Two consecutive points produce a line segment in the VRMA-VF coordinate system.

The VRMAs must be input in ascending order. The VF factor for any VRMA less than the first (lowest) input value or larger than the final (largest) input will be set to infinity. An infinite VF is represented by a negative value in the ASCII table.

File

属性

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

inTable 是一个 ASCII 文件,每行对应两列。第一列以度为单位标识 VRMA,第二列为 VF。每行指定一个点。两个连续的点生成 VRMA-VF 坐标系中的一条线段。

VRMA 必须按升序输入。对于所有小于第一个(最低)输入值或大于最后一个(最大)输入值的 VRMA,其 VF 系数将设置为无穷大。

String

代码实例

VfTable 示例 1(Python 窗口)

演示如何创建 VfTable 类以及如何在 Python 窗口的 PathDistance 工具中使用该类。

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myVerticalFactor = VfTable("vffile.txt")
outPathDist = PathDistance("source.shp", "costraster", "", "", "", "",
                           myVerticalFactor)
outPathDist.save("C:/sapyexamples/output/pathdistvft")
VfTable 示例 2(独立脚本)

使用 VfTable 类执行 PathDistance 分析。

# Name: VfTable_Ex_02.py
# Description: Uses the VfTable object to execute the PathDistance tool.
# 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
inSourceData = "source.shp"
inCostRaster = "costraster"

# Create the VfTable Object
inTable = "vffile.txt"
myVerticalFactor = VfTable(inTable)

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute PathDistance
outPathDist = PathDistance(inSourceData, inCostRaster, "", "", "", "",
                           myVerticalFactor)

# Save the output 
outPathDist.save("C:/sapyexamples/output/pathdistvft2")

相关主题

5/10/2014