HfForward (arcpy.sa)

摘要

通过向前函数定义水平成本系数和水平相对移动角度之间的关系。此函数只允许建立向前移动。

插图

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

讨论

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

如果某段行程的水平相对移动角度 (HRMA) 小于 45 度,则将水平系数 (HF) 设置为与零系数相关联的值。当 HRMA 大于或等于 45 度且小于 90 度时,将 HF 设置为边值。如果 HRMA 大于或等于 90 度,则将 HF 设置为无穷大。

语法

HfForward ({zeroFactor}, {sideValue})
参数说明数据类型
zeroFactor

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

(默认值为 0.5)

Double
sideValue

Identifies the HF value that will be assigned for HRMAs that are equal to or less than 45 degrees and less than 90 degrees. In the diagram above, the sideValue is assigned 1.

(默认值为 1.0)

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
sideValue
(读写)

Identifies the HF value that will be assigned for HRMAs that are equal to or less than 45 degrees and less than 90 degrees. In the diagram above the sideValue is assigned 1.

Double

代码实例

HfForward 示例 1(Python 窗口)

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

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myHorizFactor = HfForward(0.5, 1.0)
outPathDist = PathDistance("sourcepts.shp", "costraster", "", "", myHorizFactor)
outPathDist.save("C:/sapyexamples/output/pathdisthff")
HfForward 示例 2(独立脚本)

使用 HfForward 类执行 PathDistance 分析。

# Name: HfForward_Ex_02.py
# Description: Uses the HfForward 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 = "costraster"

# Create the HfForward Object
zeroFactor = 0.5
sideValue = 1.0
myHorizFactor = HfForward(zeroFactor, sideValue)

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

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

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

相关主题

9/15/2013