HfBinary (arcpy.sa)

摘要

通过二进制函数定义水平成本系数和水平相对移动角度之间的关系。如果水平相对移动角度小于交角,则将水平系数设置为与零系数相关联的值;否则为无穷大。

插图

HfBinary 水平系数图像
路径距离功能的 HfBinary 水平系数。

讨论

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

当水平相对移动角度 (HRMA) 小于交角时,将移过像元部分的水平系数 (HF) 设置为与零系数相关联的值。如果 HRMA 大于交角,则将此部分的 HF 设置为无穷大。

语法

HfBinary ({zeroFactor}, {cutAngle})
参数说明数据类型
zeroFactor

The zeroFactor will be used to position the y-intercept of the binary function.

(The zeroFactor is assigned as the horizontal factor when HRMA is less then the cutAngle.)

(默认值为 1.0)

Double
cutAngle

The cutAngle establishes the HRMA degree threshold beyond which the HFs are set to infinity.

(When the HRMA is less than the cutAngle the horizontal factor is assigned to the zeroFactor; when the HRMA is greater than the cutAngle the horizontal factor is assigned infinity.)

(默认值为 45)

Double

属性

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

The zeroFactor will be used to position the y-intercept of the function.

The zeroFactor is assigned as the horizontal factor when HRMA is less then the cut angle.

Double
cutAngle
(读写)

The cutAngle establishes the HRMA degree threshold beyond which the HFs are set to infinity.

When the HRMA is less than the cut angle then the zero factor is assigned and when the HRMA is greater than the cut angle, infinity is assigned.

Double

代码实例

HfBinary 示例 1(Python 窗口)

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

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myHfBinary = HfBinary(1.5, 45.5)
outPathDist = PathDistance("source.shp", "elevation", "", "", myHfBinary)
outPathDist.save("C:/sapyexamples/output/pathdisthfb")
HfBinary 示例 2(独立脚本)

使用 HFBinary 类执行 PathDistance 分析。

# Name: HfBinary_Ex_02.py
# Description: Uses the HFBinary 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 = "sourcepts.shp"
inCostRaster = "elevation"

# Create the HfBinary Object
zeroFactor = 1.0
cutAngle = 45.0
myHorizFactor = HfBinary(zeroFactor, cutAngle)

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

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

# Save the output 
outPathDist.save("C:/sapyexamples/output/pathdisthfb2")
9/15/2013