HfBinary
Resumen
Defines the relationship between the horizontal cost factor and the horizontal relative moving angle through a binary function. If the horizontal relative moving angle is less than the cut angle, the horizontal factor is set to the value associated with the zero factor; otherwise it is infinity.

Debate
This object is used in the Distance Accumulation and Distance Allocation Spatial Analyst tools, as well as the Path Distance, Path Distance Allocation, and Path Distance Back Link Legacy Distance tools.
When the horizontal relative moving angle (HRMA) is less than the cut angle, the horizontal factor (HF) for moving through the section of the cell is set to the value associated with the zeroFactor. If the HRMA is greater than the cutAngle, the HF for the section is set to infinity.
Sintaxis
HfBinary({zeroFactor}, {cutAngle})
| Nombre | Explicación | Tipo de datos |
|---|---|---|
|
zeroFactor (Opcional) |
The (The The default value is 1.0. |
Double |
|
cutAngle (Opcional) |
The (When the HRMA is less than the The default value is 45. |
Double |
Propiedades
| Nombre | Explicación | Tipo de datos |
|---|---|---|
|
zeroFactor (Lectura y escritura) |
The The |
Double |
|
cutAngle (Lectura y escritura) |
The 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 |
Muestra de código
Demonstrates how to create a HfBinary class and use it in the DistanceAccumulation tool within the Python window.
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")
Performs a distance accumulation analysis using the HfBinary class.
# 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")