VfCosSec (arcpy.sa)
摘要
通过余弦/正割函数定义垂直成本系数和垂直相对移动角度 (VRMA) 之间的关系。如果 VRMA 为负数,则由余弦函数确定垂直系数,如果 VRMA 为非负数,则由正割函数确定垂直系数。
插图
讨论
VfCosSec 对象用于 Spatial Analyst 工具路径距离、路径距离分配和路径距离回溯链接。
垂直系数 (VF) 对象用于定义垂直成本系数和垂直相对移动角度 (VRMA) 之间的关系。
VF 用于定义从一个像元移至下一像元的垂直阻力。
VRMA 用于确定“起始”像元或处理像元与“终止”像元之间的坡度角。
当 VRMA 度数为负值时,VF 由 VRMA 的余弦函数确定。如 VRMA 度数为正值,VF 则由 VRMA 的正割函数确定。
语法
参数 | 说明 | 数据类型 |
lowCutAngle |
The VRMA degree defining the lower threshold, below which (less than) the VFs are set to infinity. (默认值为 -90.0) | Double |
highCutAngle |
The VRMA degree defining the upper threshold, beyond which (larger than) the VFs are set to infinity. (默认值为 90.0) | Double |
cosPower |
The power to which the values in the cosine VRMA function will be raised. The VF is determined by: VF = cos(VRMA)power (默认值为 1.0) | Double |
secPower |
The power to which the values in the secant VRMA function will be raised. The VF is determined by: VF = sec(VRMA)power (默认值为 1.0) | Double |
属性
属性 | 说明 | 数据类型 |
lowCutAngle (读写) |
The VRMA degree defining the lower threshold, below which (less than) the VFs are set to infinity. | Double |
highCutAngle (读写) |
The VRMA degree defining the upper threshold, beyond which (larger than) the VFs are set to infinity. | Double |
cosPower (读写) |
The power to which the values in the cosine VRMA function will be raised. The VF is determined by: VF = cos(VRMA)power | Double |
secPower (读写) |
The power to which the values in the secant VRMA function will be raised. The VF is determined by: VF = sec(VRMA)power | Double |
代码实例
演示如何创建 VfCosSec 类以及如何在 Python 窗口的 PathDistance 工具中使用该类。
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myVerticalFactor = VfCosSec(-90, 90, 1, 1)
outPathDist = PathDistance("source.shp", "costraster", "", "", "", "",
myVerticalFactor)
outPathDist.save("C:/sapyexamples/output/pathdistvsc")
使用 VfCosSec 类执行 PathDistance 分析。
# Name: VfCosSec_Ex_02.py
# Description: Uses the VfCosSec 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 VfCosSec Object
lowCutAngle = -90
highCutAngle = 90
cosPower = 1
secPower = 1
myVerticalFactor = VfCosSec(lowCutAngle, highCutAngle, cosPower, secPower)
# 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/pathdistvsc2")