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

讨论
此对象用于 距离累积 和 距离分配 Spatial Analyst 工具,以及 路径距离 、 路径距离分配 和 路径距离回溯链接 旧的距离工具。
当水平相对移动角度 (HRMA) 小于交角时,将移动穿过像元截面的水平系数 (HF) 设置为与 zeroFactor 关联的值。 如果 HRMA 大于 cutAngle ,则此部分的 HF 设置为无穷大。
语法
HfBinary({zeroFactor}, {cutAngle})
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
zeroFactor (可选) |
(当 HRMA 小于 (默认值为 1.0) |
Double |
|
cutAngle (可选) |
(当 HRMA 小于 (默认值为 45) |
Double |
属性
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
zeroFactor (读取和写入) |
当 HRMA 小于交角时, |
Double |
|
cutAngle (读取和写入) |
如果 HRMA 小于交角,则指定零系数;如果 HRMA 大于交角,则指定无穷大。 |
Double |
代码示例
演示了如何创建 HfBinary 类以及如何在 Python 窗口的 DistanceAccumulation 工具中使用该类。
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myHfBinary = HfBinary(1.5, 45.5)
outDistAccum = DistanceAccumulation("source.shp", "barrier.tif",
"elev.tif", "", "", "",
"horizontalRas.tif", myHfBinary)
outDistAccum.save("C:/sapyexamples/output/distaccumhfb")
使用 HfBinary 类执行 DistanceAccumulation 分析。
# Name: HfBinary_Ex_02.py
# Description: Uses the HFBinary object to run the
# DistanceAccumulation 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"
inSurfaceRaster = "elevation.tif"
inHorizontalRaster = "horizontalRas.tif"
# Create the HfBinary Object
zeroFactor = 1.0
cutAngle = 45.0
myHorizFactor = HfBinary(zeroFactor, cutAngle)
# Run
outDistAccum = DistanceAccumulation(inSourceData,"", inSurfaceRaster,"","",
"", inHorizontalRaster, myHorizFactor)
# Save the output
outDistAccum.save("C:/sapyexamples/output/distaccumhfb2")