HfTable
Summary
Defines the relationship between the horizontal cost factor and the horizontal relative moving angle through a specified table file. The table file identifies the horizontal factor graph used to determine the horizontal factors.
Discussion
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.
Syntax
HfTable(inTable)
| Name | Explanation | Data type |
|---|---|---|
|
inTable |
The |
File |
Properties
| Name | Explanation | Data type |
|---|---|---|
|
inTable (Read and Write) |
The |
String |
Code sample
Demonstrates how to create an HfTable 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"
myHorizFactor = HfTable("hffile.txt")
outDistAccum = DistanceAccumulation("source.shp", "barrier.tif",
"elev.tif", "", "", "",
"horizontalRas.tif", myHorizFactor)
outDistAccum.save("C:/sapyexamples/output/distaccumhft")
Performs a distance accumulation analysis using the HfTable class.
# Name: HfTable_Ex_02.py
# Description: Uses the HfTable 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 HfTable Object
inTable = "hffile.txt"
myHorizFactor = HfTable(inTable)
# Run PathDistance
outDistAccum = DistanceAccumulation(inSourceData,"", inSurfaceRaster,"","",
"", inHorizontalRaster, myHorizFactor)
# Save the output
outDistAccum.save("C:/sapyexamples/output/distaccumhft2")