HfTable (arcpy.sa)

摘要

通过指定表文件定义水平成本系数和水平相对移动角度之间的关系。表文件用于标识确定水平系数的水平系数图。

讨论

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

语法

HfTable (inTable)
参数说明数据类型
inTable

The inTable is an ASCII file with two columns on each line. The first column identifies the HRMA in degrees, and the second, the HF. Each line specifies a point. Two consecutive points produce a line segment in the HRMA-HF coordinate system. The angles must be input in ascending order. The HF factor for any HRMA angle less than the first (lowest) input value or larger than the last (largest) input value will be set to infinity. An infinite HF is represented by -1 in the ASCII file.

File

属性

属性说明数据类型
inTable
(读写)

The inTable is of an ASCII file with two columns on each line. The first column identifies the HRMA in degrees, and the second, the HF. Each line specifies a point. Two consecutive points produce a line segment in the HRMA-HF coordinate system. The angles must be input in ascending order. The HF factor for any HRMA angle less than the first (lowest) input value or larger than the last (largest) input value will be set to infinity. An infinite HF is represented by -1 in the ASCII file.

String

代码实例

HfTable 示例 1(Python 窗口)

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

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myHorizFactor = HfTable("hffile.txt")
outPathDist = PathDistance("source.shp", "costraster", "", "", myHorizFactor)
outPathDist.save("C:/sapyexamples/output/pathdisthft")
HfTable 示例 2(独立脚本)

使用 HfTable 类执行 PathDistance 分析。

# Name: HfTable_Ex_02.py
# Description: Uses the HfInverseLinear object to execute the HfTable 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 = "source.shp"
inCostRaster = "costraster"

# Create the HfTable Object
inTable = "hffile.txt"
myHorizFactor = HfTable(inTable)

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

相关主题

5/10/2014