HfLinear

Disponible avec une licence Spatial Analyst.

Synthèse

Defines the relationship between the horizontal cost factor and the horizontal relative moving angle through a linear function. The function specifies that the horizontal factor has a linear relationship with the horizontal relative moving angle.

Illustration

HfLinear horizontal factor graph
Graph of the linear horizontal factor.

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.

The horizontal factors (HFs) are determined by a straight line in the horizontal relative moving angle (HRMA)-HF coordinate system. The line intercepts the y-axis, equitable to the HF factor, at the value associated with the zeroFactor. The slope of the line can be specified using the slope modifier. If no slope is identified, the default is 0.5/45 or 1/90 (specified as 0.01111).

Syntaxe

HfLinear ({zeroFactor}, {cutAngle}, {slope})
ParamètreExplicationType de données
zeroFactor

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

(La valeur par défaut est 0.5)

Double
cutAngle

The cutAngle establishes the HRMA degree threshold beyond which the HFs are set to infinity.

(La valeur par défaut est 181.0)

Double
slope

Identifies the slope of the straight line in the HRMA-HF coordinate system. Slope is specified as the rise over the run. For example, a 30-degree slope is 1/30, specified as 0.03333 (rise/run: 1 HF on the y axis / 30 degrees on the x axis).

(La valeur par défaut est 0.011111)

Double

Propriétés

PropriétéExplicationType de données
zeroFactor
(Lecture et écriture)

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
cutAngle
(Lecture et écriture)

The cutAngle establishes the HRMA degree threshold beyond which the HFs are set to infinity.

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
slope
(Lecture et écriture)

Identifies the slope of the straight line in the HRMA-HF coordinate system. Slope is specified as the rise over the run. For example, a 30-degree slope is 1/30, specified as 0.03333 (rise/run: 1 HF on the y axis / 30 degrees on the x axis).

Double

Exemple de code

HfLinear example 1 (Python window)

Demonstrates how to create an HfLinear 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 = HfLinear(0.5, 181.0, 0.01111)
outDistAccum = DistanceAccumulation("source.shp", "barrier.tif",
                                    "elev.tif", "", "", "",
                                    "horizontalRas.tif", myHorizFactor)
outDistAccum.save("C:/sapyexamples/output/distaccumhfL")
HfLinear example 2 (stand-alone script)

Performs a DistanceAccumulation analysis using the HfLinear class.

# Name: HfLinear_Ex_02.py
# Description: Uses the HfLinear 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 HfLinear Object
zeroFactor = 0.5
cutAngle = 181.0
slope = 0.01111
myHorizFactor = HfLinear(zeroFactor, cutAngle, slope)

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

# Execute PathDistance
outDistAccum = DistanceAccumulation(inSourceData,"", inSurfaceRaster,"","",
                                    "", inHorizontalRaster, myHorizFactor)

# Save the output 
outDistAccum.save("C:/sapyexamples/output/distaccumhfl2")

Rubriques connexes