HfForward

摘要

Defines the relationship between the horizontal cost factor and the horizontal relative moving angle through a forward function. The function establishes that only forward movement is allowed.

插图

HfForward horizontal factor image
HfForward horizontal factor for the PathDistance functions.

讨论

The HfForward object is used in the Spatial Analyst tools Path Distance, Path Distance Allocation, and Path Distance Back Link.

If a horizontal relative moving angle (HRMA) is less than 45 degrees for a section of travel, the horizontal factor (HF) is set to the value associated with the zeroFactor. When the HRMA is larger than or equal to 45 degrees and less than 90 degrees, the HF is set to the sideValue. If the HRMA is equal to or greater than 90 degrees, the HF is set to infinity.

语法

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 example 1 (Python window)

Demonstrates how to create an HfForward class and use it in the PathDistance tool within the Python window.

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 example 2 (stand-alone script)

Performs a PathDistance analysis using the HfForward class.

# 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")

相关主题


7/10/2012