Path Distance |
|
Release 9.2
Last modified January 3, 2008 |
![]() ![]() ![]() Print all topics in : "Distance (Spatial Analyst)" |
Calculates, for each cell, the least accumulative cost distance to the nearest source, while accounting for surface distance and horizontal and vertical cost factors.
Learn more about how Path Distance works
Usage tips
Command line and Scripting
Learn more about Path Distance - adding more cost complexity
The input source data can be a feature class or raster.
When the input source data is a raster, the set of source cells consists of all cells in the source raster that have valid values. Cells that have NoData values are not included in the source set. The value zero is considered a legitimate source. A source raster can be easily created using the Extract By tools.
Cells with NoData act as barriers in the Path Distance functions. The cost distance for cells behind NoData values is calculated by the accumulative cost necessary to move around the NoData barrier. Any cell location assigned NoData on any one of the input rasters will receive NoData on all output rasters.
If the input source data and input cost raster are different extents, the default output extent is the intersection of the two. To get a cost distance surface for the entire extent, choose Union of Inputs on the Raster Settings of the Environment Settings.
If a mask has been set in the environment, any masked cells will be treated as NoData values.
When a mask has been defined within the Analysis window and the cells to be masked will mask a source, the Path Distance surface calculations will occur on the remaining source cells. The source cells that are masked will not be considered in the computations. These cell locations will be assigned NoData on all output rasters.
The output of the Aspect tool can be used as input for the Horizontal factor.
The maximum distance is specified in the same cost units as those on the input surface raster.
The output type for the output distance raster always contains all floating-point values. The output type for the output backlink raster is always integer.
The least-cost-path distance or minimum accumulative cost distance of a cell from a set of source locations is the lower bound of the least-cost path distance to the cell from all source locations.
The default values for the Horizontal factor modifiers are:
Keywords Zero factor Cut angle Slope Side value -------------- ----------- ----------- ----- --------- Binary 1.0 45 ~ ~ Forward 0.5 45 (fixed) ~ 1.0 Linear 0.5 181 1/90 ~ Inverse linear 2.0 180 -1/90 ~
The default values for the Vertical factor modifiers are:
Keyword Zero factor Low cut Height cut Slope Power Cos Sec angle angle power power ------------------------ ----------- ------- ---------- ----- ----- ----- ----- Binary 1.0 -30 30 ~ ~ ~ ~ Linear 1.0 -90 90 1/90 ~ ~ ~ Symmetric linear 1.0 -90 90 1/90 ~ ~ ~ Inverse linear 1.0 -45 45 -1/45 ~ ~ ~ Symmetric inverse linear 1.0 -45 45 -1/45 ~ ~ ~ Cos ~ -90 90 ~ 1.0 ~ ~ Sec ~ -90 90 ~ 1.0 ~ ~ Cos_sec ~ -90 90 ~ ~ 1.0 1.0 Sec_cos ~ -90 90 ~ ~ 1.0 1.0
Map Algebra
The set of source cells consists of all cells in the source raster that have valid values. Cells that have NoData values are not included in the source set. The value zero is considered a legitimate source. A source raster can be easily created using the Select function.
Cells with NoData act as barriers in the cost surface functions.
The cost distance for cells behind NoData values is calculated by the accumulative cost necessary to move around the NoData barrier. Any cell location assigned NoData on any one of the input rasters (except {value_grid}) will receive NoData on all three output rasters: cost distance, cost allocation, and cost back link.
If a mask has been set using the ArcGIS Spatial Analyst Option dialog box, any masked cells will be treated as NoData values.
When a mask has been defined within the Analysis window and the cells to be masked will mask a source, the cost surface calculations will occur on the remaining source cells. The source cells that are masked will not be considered in the computations. These cell locations will be assigned NoData on all three output rasters: cost distance, cost allocation, and cost back link.
The output of the Aspect function can be used as input for the {horiz_factor_grid}.
The {value_grid} is useful if the <source_grid> was derived from the Test or Boolean functions, since the results are either one or NoData. With these functions, the original zone values on the input raster associated with these locations are lost. The {value_grid} can either restore these values or allow for additional combinations of zone value configurations within the source cells to be analyzed.
If a {value_grid} is used, it may change the configuration and results of the cost allocation output; it will not affect the cost distance or the back link results.
The {max_distance} is specified in the same cost units as those on the cost surface raster.
The least-cost path distance or minimum accumulative cost distance of a cell from a set of source cells is the lower bound of the least-cost-path distance to the cell from all source cells.
The output type for the path distance raster always contains all floating-point values.
The output values for the cost back link and the cost allocation rasters are always integer.
Learn more about how to specify the input raster dataset in the Map Algebra expression of Raster Calculator.
ArcObjects
When using ArcGIS Spatial Analyst DistanceOp, the sourceData can be a feature class or raster.
When the sourceData is raster, the set of source cells consists of all cells that have valid values. Cells that have NoData values are not included in the source set. The value zero is considered a legitimate source.
Cell locations with NoData in the costRaster act as barriers in the cost surface functions. Any cell location that is assigned NoData on the input costRaster will receive NoData on the output raster.
If a mask has been set, all masked cells will be treated as NoData values.
When a mask has been defined and the cells to be masked will mask a source, the cost surface calculations will occur on the remaining sourceData. The source cells that are masked will not be considered in the computations. These cell locations will be assigned NoData on the output raster.
The [maxDistance] is specified in the same cost units as those on the costRaster.
The least-cost distance or minimum accumulative cost distance of a cell to a set of source cells is the lower bound of the least-cost distance from the cell to all source cells.
If a [valueRaster] is used, it may change the configuration and results of the path distance allocation output; it will not affect the path distance or the path distance back link results.
The output from the PathDistance object method is a raster.
The output type for the distance raster is floating point.
Command line syntax
An overview of the Command Line window
PathDistance_sa <in_source_data> <out_distance_raster> {in_cost_raster} {in_surface_raster} {in_horizontal_raster} {horizontal_factor} {in_vertical_raster} {vertical_factor} {maximum_distance} {out_backlink_raster}
Parameter | Explanation | Data Type |
<in_source_data> |
Input source locations. A raster or feature dataset that identifies the cells or locations to which the least accumulated cost distance for every cell is calculated. For rasters, it must be of integer type. For features, only integer fields can be used. |
Composite Geodataset |
<out_distance_raster> |
The name of the output path distance raster. The path distance raster identifies, for each cell, the least accumulative cost path distance to the identified source locations. A source can be a cell, a set of cells, or one or more feature locations. |
Raster Dataset |
{in_cost_raster} |
A raster defining the impedance, or cost, to move planimetrically through each cell. The value at each cell location represents the cost per unit of surface distance for moving through the cell. Each cell location value is multiplied by the cell resolution, while compensating for diagonal movement, to obtain the total cost of passing through the cell. The values on the {in_cost_raster} can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost). |
Composite Geodataset |
{in_surface_raster} |
A raster defining the elevation values at each cell location. The values are used to calculate the actual surface distance that will be covered when passing between cells. |
Composite Geodataset |
{in_horizontal_raster} |
A raster defining the horizontal direction at each cell. The values on the raster must be integers ranging from 0 to 360 with 0 degrees being north, or toward the top of the screen, and increasing clockwise. Flat areas should be given a value of -1. The values at each location will be used in conjunction with the {horizontal_factor} to determine the horizontal cost incurred when moving from a cell to its neighbors. |
Composite Geodataset |
{horizontal_factor} |
Defines the relationship between the horizontal cost factor and the horizontal relative moving angle (HRMA). There are several factors with modifiers from which to select that identify a defined horizontal factor graph. Additionally, a table can be used to create a custom graph. The graphs are used to identify the horizontal factor used in calculating the total cost for moving into a neighboring cell. In the explanations below, two acronyms are used: 'HF' stands for horizontal factor, which defines the horizontal difficulty encountered in moving from one cell to the next. 'HRMA' stands for horizontal relative moving angle, which identifies the angle between the horizontal direction from a cell and the moving direction. Horizontal factor types:
Modifiers to the horizontal keywords:
To summarize, the horizontal factor types are: Binary Zero factor Cut angle Forward Zero factor Side value Linear Zero factor Cut angle Slope Inverse_Linear Zero factor Cut angle Slope Table Table name |
Horizontal factor |
{in_vertical_raster} |
A raster defining the z-values for each cell location. The values are used for calculating the slope used to identify the vertical factor incurred when moving from one cell to another. |
Composite Geodataset |
{vertical_factor} |
Defines the relationship between the vertical cost factor and the vertical relative moving angle (VRMA). There are several factors with modifiers from which to select that identify a defined vertical factor graph. Additionally, a table can be used to create a custom graph. The graphs are used to identify the vertical factor used in calculating the total cost for moving into a neighboring cell. In the explanations below, two acronyms are used: 'VF' stands for vertical factor, which defines the vertical difficulty encountered in moving from one cell to the next. 'VRMA' stands for vertical relative moving angle, which identifies the slope angle between the FROM or processing cell and the TO cell. Vertical factor types:
Modifiers to the vertical keywords:
To summarize, the vertical factor types are:
Binary Zero factor Low cut angle High cut angle Linear Zero factor Low cut angle High cut angle Slope Inverse Linear Zero factor Low cut angle High cut angle Slope Symmetric Linear Zero factor Low cut angle High cut angle Slope Symmetric Inverse Linear Zero factor Low cut angle High cut angle Slope Cos Low cut angle High cut angle Power Sec Low cut angle High cut angle Power Cos-Sec Low cut angle High cut angle Cos power Sec power Sec-Cos Low cut angle High cut angle Cos power Sec power Table Table name |
Vertical factor |
{maximum_distance} |
Defines the threshold that the accumulative cost distance values cannot exceed. If an accumulative cost distance value exceeds the {max_distance}, the output value for the cell will be NoData. The {maximum_distance} defines the extent to which the accumulative cost distances are computed. |
Double |
{out_backlink_raster} |
The name of the output back link raster. The back link raster contains values of 0 through 8, which define the direction or identify the next neighboring cell (the succeeding cell) along the least accumulative cost path from a cell to reach its least cost source. If the path is to pass into the right neighbor, the cell will be assigned the value 1, 2 for the lower right diagonal cell, and continuing clockwise. The value 0 is reserved for source cells. |
Raster Dataset |
PathDistance_sa C:/data/source_ras C:/data/out_dist C:/data/cost_ras C:/data/surface C:/data/hor_ras "BINARY 1 30" C:/data/ver_ras "LINEAR 1 -60 60 0.02" "" C:/data/out_blink
Scripting syntax
About getting started with writing geoprocessing scripts
PathDistance_sa (in_source_data, out_distance_raster, in_cost_raster, in_surface_raster, in_horizontal_raster, horizontal_factor, in_vertical_raster, vertical_factor, maximum_distance, out_backlink_raster)
Parameter | Explanation | Data Type |
in_source_data (Required) |
Input source locations. A raster or feature dataset that identifies the cells or locations to which the least accumulated cost distance for every cell is calculated. For rasters, it must be of integer type. For features, only integer fields can be used. |
Composite Geodataset |
out_distance_raster (Required) |
The name of the output path distance raster. The path distance raster identifies, for each cell, the least accumulative cost path distance to the identified source locations. A source can be a cell, a set of cells, or one or more feature locations. |
Raster Dataset |
in_cost_raster (Optional) |
A raster defining the impedance, or cost, to move planimetrically through each cell. The value at each cell location represents the cost per unit of surface distance for moving through the cell. Each cell location value is multiplied by the cell resolution, while compensating for diagonal movement, to obtain the total cost of passing through the cell. The values on the {in_cost_raster} can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost). |
Composite Geodataset |
in_surface_raster (Optional) |
A raster defining the elevation values at each cell location. The values are used to calculate the actual surface distance that will be covered when passing between cells. |
Composite Geodataset |
in_horizontal_raster (Optional) |
A raster defining the horizontal direction at each cell. The values on the raster must be integers ranging from 0 to 360 with 0 degrees being north, or toward the top of the screen, and increasing clockwise. Flat areas should be given a value of -1. The values at each location will be used in conjunction with the {horizontal_factor} to determine the horizontal cost incurred when moving from a cell to its neighbors. |
Composite Geodataset |
horizontal_factor (Optional) |
Defines the relationship between the horizontal cost factor and the horizontal relative moving angle (HRMA). There are several factors with modifiers from which to select that identify a defined horizontal factor graph. Additionally, a table can be used to create a custom graph. The graphs are used to identify the horizontal factor used in calculating the total cost for moving into a neighboring cell. In the explanations below, two acronyms are used: 'HF' stands for horizontal factor, which defines the horizontal difficulty encountered in moving from one cell to the next. 'HRMA' stands for horizontal relative moving angle, which identifies the angle between the horizontal direction from a cell and the moving direction. Horizontal factor types:
Modifiers to the horizontal keywords:
To summarize, the horizontal factor types are: Binary Zero factor Cut angle Forward Zero factor Side value Linear Zero factor Cut angle Slope Inverse_Linear Zero factor Cut angle Slope Table Table name |
Horizontal factor |
in_vertical_raster (Optional) |
A raster defining the z-values for each cell location. The values are used for calculating the slope used to identify the vertical factor incurred when moving from one cell to another. |
Composite Geodataset |
vertical_factor (Optional) |
Defines the relationship between the vertical cost factor and the vertical relative moving angle (VRMA). There are several factors with modifiers from which to select that identify a defined vertical factor graph. Additionally, a table can be used to create a custom graph. The graphs are used to identify the vertical factor used in calculating the total cost for moving into a neighboring cell. In the explanations below, two acronyms are used: 'VF' stands for vertical factor, which defines the vertical difficulty encountered in moving from one cell to the next. 'VRMA' stands for vertical relative moving angle, which identifies the slope angle between the FROM or processing cell and the TO cell. Vertical factor types:
Modifiers to the vertical keywords:
To summarize, the vertical factor types are:
Binary Zero factor Low cut angle High cut angle Linear Zero factor Low cut angle High cut angle Slope Inverse Linear Zero factor Low cut angle High cut angle Slope Symmetric Linear Zero factor Low cut angle High cut angle Slope Symmetric Inverse Linear Zero factor Low cut angle High cut angle Slope Cos Low cut angle High cut angle Power Sec Low cut angle High cut angle Power Cos-Sec Low cut angle High cut angle Cos power Sec power Sec-Cos Low cut angle High cut angle Cos power Sec power Table Table name |
Vertical factor |
maximum_distance (Optional) |
Defines the threshold that the accumulative cost distance values cannot exceed. If an accumulative cost distance value exceeds the {max_distance}, the output value for the cell will be NoData. The {maximum_distance} defines the extent to which the accumulative cost distances are computed. |
Double |
out_backlink_raster (Optional) |
The name of the output back link raster. The back link raster contains values of 0 through 8, which define the direction or identify the next neighboring cell (the succeeding cell) along the least accumulative cost path from a cell to reach its least cost source. If the path is to pass into the right neighbor, the cell will be assigned the value 1, 2 for the lower right diagonal cell, and continuing clockwise. The value 0 is reserved for source cells. |
Raster Dataset |
# PathDistance_sample.py # Description: # Calculates for each cell the least accumulative cost distance # to the nearest source over a cost surface while accounting # for surface distance and horizontal and vertical cost factors. # Requirements: None # Author: ESRI # Date: Sept 6, 2005 # Import system modules import arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create() try: # Set local variables InSourceRas = "C:/data/source_ras" OutDistanceRaster = "C:/data/out_dist" InCostRas = "C:/data/cost_ras" InSurfaceRas = "C:/data/surface" InHorRas = "C:/data/hor_ras" InHorFactor = "BINARY 1 30" InVerRas = "C:/data/ver_ras" InVerFact = "LINEAR 1 -60 60 0.02" InMaxDistance = "" OutBackLinkRaster = "C:/data/out_blink" # Check out ArcGIS Spatial Analyst extension license gp.CheckOutExtension("Spatial") # Process: PathDistance gp.PathDistance_sa(InSourceRas, OutDistanceRaster, InCostRas, InSurfaceRas, InHorRas, InHorFactor, InVerRas, InVerFact, InMaxDistance, OutBackLinkRaster) except: # If an error occurred while running a tool, then print the messages. print gp.GetMessages()
Map Algebra syntax
PathDistance(<source_grid>, {cost_grid}, {surface_grid}, {horiz_factor_grid}, {horiz_factor_parm}, {vert_factor_grid}, {vert_factor_parm}, {o_backlink_grid}, {o_allocate_grid}, {max_distance}, {value_grid})
Parameter | Explanation |
<source_grid> | A raster that identifies those cells from which a least accumulative cost distance is calculated to each cell.
The input value types can be either integer or floating point. |
{cost_grid} | A raster defining the impedance or cost to move planimetrically through each cell.
The value at each cell location represents the cost per unit of surface distance for moving through the cell. Each cell location value is multiplied by the cell resolution, while compensating for diagonal movement, to obtain the total cost of passing through the cell. The values on the {cost_grid} can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost). |
{surface_grid} | A raster identifying the z-values at each cell location.
The values are used to calculate the actual surface distance covered when passing between cells. |
{horiz_factor_grid} | A raster defining the horizontal direction at each cell.
The values on the raster must be integers ranging from 0 to 360 with 0 degrees being north, or towards the top of the screen, and increasing clockwise. Flat areas should be given the value of -1. The values at each location will be used in conjunction with the {horiz_factor_parm} to determine the horizontal cost incurred when moving from a cell to its neighbors. |
{horiz_factor_parm} | Defines the relationship between the horizontal cost factor and the horizontal relative moving angle (HRMA).
The input parameter may be one of several keywords (and modifiers) identifying a defined horizontal factor graph or an ASCII file that creates a custom graph. The graphs are used to identify the horizontal factor used in calculating the total cost for moving into a neighboring cell. If the parameter is used with any modifier, the string must be double quoted. The format for the horizontal parameter is: "keyword {modifier_1 ... modifier_n}" Spaces must be used to separate the keyword and modifiers. The format for the horizontal parameter modifiers is: modifier_name=value or table_name There is an equal sign (=) between the modifier name and its value, but there are no spaces between any of the three. If no keyword is specified, the default horizontal parameter is BINARY. Two acronyms are used in the explanations of the horizontal factor keywords and modifiers: HF stands for horizontal factor, which defines the horizontal difficulty encountered when moving from one cell to the next. HRMA stands for horizontal relative moving angle, which identifies the angle between the horizontal direction from a cell and the moving direction. Horizontal-factor keywords:
Modifiers to the horizontal keywords:
Default Values for Horizontal Factor Modifiers: Keywords Zerofactor Cutangle Slope Sidevalue Binary 1.0 45 ~ ~ Forward 0.5 45(fixed) ~ 1.0 Linear 0.5 181 1/90 ~ Inverse_linear 2.0 180 -1/90 ~ |
{vert_factor_grid} | A raster defining the z-values for each cell location.
The values are used for calculating the slope used to identify the vertical factor incurred when moving from one cell to another. |
{vert_factor_parm} | Defines the relationship between the vertical cost factor and the vertical relative moving angle (VRMA).
The input parameter may be one of several keywords (and modifiers) identifying a defined vertical factor graph or an ASCII file creating a custom graph. The graphs are used to identify the vertical factor used in calculating the total cost for moving into a neighboring cell. If the parameter is used with any modifier, the string must be double quoted. The format for the vertical parameter is: "keyword {modifier_1 ... modifier_n}" Spaces must be used to separate the keyword and modifiers. The format for the vertical parameter modifiers is: modifier_name=value or table_name There is an equal sign (=) between the modifier name and its value, but there are no spaces between any of the three. If no keyword is specified, the default vertical parameter is SEC. Two acronyms are used in the explanations of the vertical factor keywords and modifiers: VF stands for vertical factor, which defines the vertical difficulty encountered when moving from one cell to the next. VRMA stands for vertical relative moving angle, which identifies the slope angle between the FROM or processing cell and the TO cell. Vertical-factor keywords:
Modifiers to the vertical factor keywords:
Default Values for Vertical Factor Modifiers KEYWORDS ZEROFACTOR LCUTANGLE HCUTANGLE SLOPE COSPOWER SECPOWER Binary 1.0 -30 30 ~ ~ ~ Linear 1.0 -90 90 1/90 ~ ~ Sym_linear 1.0 -90 90 1/90 ~ ~ Inverse_linear 1.0 -45 45 -1/45 ~ ~ Sym_inverse_linear 1.0 -45 45 -1/44 ~ ~ Cos ~ -90 90 ~ 1.0 ~ Sec ~ -90 90 ~ ~ 1.0 Cos_sec ~ -90 90 ~ 1.0 1.0 Sec_cos ~ -90 90 ~ 1.0 1.0 |
{o_backlink_grid} | The name of the output back link raster.
The back link raster contains values of 0 through 8, which is a code identifying the direction of the next neighboring cell (the succeeding cell) when retracing (from the destination to the source) the least accumulative cost path from a source cell to a destination. If the path is to pass into the right neighbor, the cell will be assigned the value 1, 2 for the lower right diagonal cell, and continuing clockwise. The value 0 is reserved for source cells. ![]() |
{o_allocate_grid} | The name of the output cost allocation raster.
The output raster defines, for each cell, the zone on the <source_grid> that achieves the minimum cost distance or the least accumulative cost to reach the cell. |
{max_distance} | Defines the threshold that the accumulative cost distance values cannot exceed.
If an accumulative cost distance value exceeds the {max_distance}, the output value for the cell will be NODATA. The {max_distance} defines the extent to which the accumulative cost distances are computed. |
{value_grid} | An optional input raster that identifies the zone value that should be used for each cell on the <source_grid>.
The value defined by the {value_grid} for each source cell will be assigned to all cells that are allocated to the source cell location in terms of the minimum cost distance. The default zone value for a source cell is the value on <source_grid>. This parameter can be used if other values or zones are used instead of those existing in the input source raster. This parameter can also be used if the source raster was created by the Test function, a Boolean operator that will only output the binary values zero and one. |
pathdistance(source, cost) pathdistance(source, cost, surface, #, #, #, #, out_back, out_alloc) pathdistance(source, cost, surface, horiz, LINEAR, vert, COS, out_back, out_alloc, 500) pathdistance(source, cost, #, horiz, "BINARY CUTANGLE=120", vert, "LINEAR SLOPE=0.0111", #, value_grid.ph) pathdistance(test(ingrid1 > 5), cost, horiz.cost2, vert, "TABLE vftable", out_back, #, #, value_grid) pathdistance(source, ingrid1 + ingrid2, #, surface, horiz, #, vert, #, out_all, 1000)
ArcObjects syntax
IDistanceOp::PathDistance (sourceData As IGeoDataset, [costRaster], [surfaceRaster], [horizRaster], [horizFactor], [vertRaster], [vertFactor], [maxDistance], [valueRaster]) as IGeoDataset
Parameter | Explanation |
sourceData | An input Raster, RasterDataset, RasterBand, RasterDescriptor, FeatureClass, or FeatureClassDescriptor that identifies those cells to which the least accumulated cost distance for every cell is calculated.
The input value types can be either integer or floating point. |
[costRaster] | An input Raster, RasterDataset, RasterBand, or RasterDescriptor defining the impedance or cost to move planimetrically through each cell.
The value at each cell location represents the cost per unit distance for moving through the cell. Each cell location value is multiplied by the cell resolution, while compensating for diagonal movement, to obtain the total cost of passing through the cell. The values on the costRaster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost). |
[surfaceRaster] | An input Raster, RasterDataset, RasterBand, or RasterDescriptor defining the elevation values at each cell location.
The values are used to calculate the actual surface distance covered when passing between cells. |
[horizRaster] | An input Raster, RasterDataset, RasterBand, or RasterDescriptor defining the horizontal direction at each cell.
The values must be integers ranging from 0 to 360 with 0 degrees being north, or toward the top of the screen, and increasing clockwise. Flat areas should be given the value of -1. The values at each location will be used in conjunction with the horizFactor to determine the horizontal cost incurred when moving from a cell to its neighbors. |
[horizFactor] | The esriPathDistanceHorizontalEnum defining the relationship between the horizontal cost factor and the horizontal relative moving angle (HRMA).
The available enums are: esriPathDistanceHorizontalInvalid esriPathDistanceHorizontalBinary esriPathDistanceHorizontalForward esriPathDistanceHorizontalLinear esriPathDistanceHorizontalInverseLinear esriPathDistanceHorizontalTable |
[vertRaster] | An input Raster, RasterDataset, RasterBand, or RasterDescriptor defining the z-value at each cell.
The values are used for calculating the slope used to identify the vertical factor incurred when moving from one cell to another. |
[vertFactor] | The esriPathDistanceVerticalEnum defining the relationship between the vertical cost factor and the vertical relative moving angle (VRMA).
The available enums are: esriPathDistanceVerticalInvalid esriPathDistanceVerticalBinary esriPathDistanceVerticalLinear esriPathDistanceVerticalInverseLinear esriPathDistanceVerticalTable esriPathDistanceVerticalSymLinear esriPathDistanceVerticalSymInverseLinear esriPathDistanceVerticalCos esriPathDistanceVerticalSec esriPathDistanceVerticalCosSec esriPathDistanceVerticalSecCos |
[maxDistance] | Defines the threshold that the accumulative cost values cannot exceed.
If an accumulative cost distance value exceeds the maxDistance, the output value for the cell location will be NoData. The maxDistance defines the extent at which the accumulative cost distances are calculated. If no maxDistance is specified, the distance will be measured to the edge of the output raster. The data type for maxDistance can be either integer or floating point. |
[valueRaster] | An optional input raster that identifies the zone values that should be used for each cell on the sourceData.
The value defined by the valueRaster for each source cell will be assigned to all cells allocated to the source cell in the cost allocation computations. If no valueRaster is specified, the zone value for a source cell is the value on the sourceData. This parameter can be used if other values or zones are used instead of those existing in the input source. This parameter can also be used if the source raster was created by the ILogicalOp::Test or ILogicalOp::Boolean methods, which only output the binary values zero and one. The data type for the valueRaster can be Raster, RasterDataset, RasterBand, or RasterDescriptor. |
Sub PathDistance_Example() ' Calculates for each cell the least-accumulative-path distance over a path ' surface to a source cell or a set of source cells. ' ' PathDistance(ByVal sourceData As esriGeoDatabase.IGeoDataset, _ ' [costRaster], [surfaceRaster], [horizRaster], [horizFactor], _ ' [vertRaster], [vertFactor], [maxDistance], [valueRaster]) _ ' As esriGeoDatabase.IGeoDataset On Error GoTo ErrorHandler Dim pDistanceOp As IDistanceOp2 Set pDistanceOp = New RasterDistanceOp ' Dataset names Dim sRasNm01 As String sRasNm01 = "C:\data\Source" Dim sRasNm02 As String sRasNm02 = "C:\data\HorRas" ' Open dataset as a raster using an utility function Dim pRas01 As IRaster Set pRas01 = Util_CreateDefaultIRaster(sRasNm01) Dim pRas02 As IRaster Set pRas02 = Util_CreateDefaultIRaster(sRasNm02) ' Create Raster Analysis Environment Dim pEnv As IRasterAnalysisEnvironment Set pEnv = pDistanceOp Set pEnv.OutWorkspace = Util_OpenIRasterWorkspace("C:\data") ' Create Horizontal Factor Dim pHF As IPathDistanceHorizontalFactor Set pHF = New PathDistanceHorizontalFactor pHF.SetForward 0.5, 1 ' Execute the method Dim pRasOut As IRaster Set pRasOut = pDistanceOp.PathDistance(pRas01, , , pRas02, pHF) Exit Sub ErrorHandler: MsgBox Err.Description & " " & Err.Source End Sub