Skip to main content

HfBinary

汇总

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

HfBinary 水平系数图

二进制水平系数图

讨论

此对象用于 距离累积距离分配 Spatial Analyst 工具,以及 路径距离路径距离分配路径距离回溯链接 旧的距离工具。

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

语法

HfBinary({zeroFactor}, {cutAngle})

名称 说明 数据类型

zeroFactor

(可选)

zeroFactor 将用于确定二元函数的 y 截距。

(当 HRMA 小于 cutAngle 时, zeroFactor 将被指定为水平系数。)

(默认值为 1.0)

Double

cutAngle

(可选)

cutAngle 用于确定 HRMA 角度阈值,HRMA 大于该角度时会将 HF 设置为无穷大。

(当 HRMA 小于 cutAngle 时,水平系数将被指定为 zeroFactor ,当 HRMA 大于 cutAngle 时,水平系数将被指定为 无穷大。)

(默认值为 45)

Double

属性

名称 说明 数据类型

zeroFactor

(读取和写入)

zeroFactor 将用于确定函数的 y 截距。

当 HRMA 小于交角时, zeroFactor 将被指定为水平系数。

Double

cutAngle

(读取和写入)

cutAngle 用于确定 HRMA 角度阈值,HRMA 大于该角度时会将 HF 设置为无穷大。

如果 HRMA 小于交角,则指定零系数;如果 HRMA 大于交角,则指定无穷大。

Double

代码示例

HfBinary 示例 1(Python 窗口)

演示了如何创建 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 示例 2(独立脚本)

使用 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")