- URL:
- https://<root>/<serviceName>/RasterAnalysisTools/GPServer/DistanceAccumulation
- Methods:
GET
- Version Introduced:
- 10.8.1
Description
The Distance
task calculates accumulated distance for each cell to sources, allowing for straight-line distance, cost distance, and true surface distance, as well as vertical and horizontal cost factors.
The Distance
operation calculates straight-line distance or the least accumulative cost distance for each cell to the source over a cost surface, while optionally accounting for the surface distance and the horizontal and vertical factors.
To properly handle the edge of the projection at a global extent when performing distance analysis at a global scale, ensure that either a cylindrical projection or a geographic output coordinate system is used in conjunction with the Geodesic
option for the Distance Method
parameter.
Example applications include the following:
- Identify the least expensive route to construct a new road to a proposed school.
- Connect the best habitat patches for bobcats with wildlife corridors to allow the species to move between the patches.
- Calculate the actual cost and distance for a proposed road adjusting for the uphill and downhill changes in the landscape.
Request parameters
Parameter | Details |
---|---|
| A layer that identifies the locations from or to which the least accumulated cost distance for every output cell location is calculated. Syntax: This parameter can have either a raster input or a feature input. For raster input, this parameter can be specified as a portal item ID, a URL to a raster image service layer, a cloud raster dataset, or a shared raster dataset. For feature input, this parameter can be specified as either a URL to a feature service layer or a feature collection. Raster input examples:
Feature input examples:
|
| The output distance image service name that will be created. This calculates, for each cell, the accumulative distance to the closest source. You can specify the name, or you can create an empty service using Portal Admin Sharing API and use the return JSON object as input to this parameter. Syntax: A JSON object describes the name of the output or the output raster. Output name example:
Output raster examples:
|
|
The dataset that defines the barriers. The barriers can be defined by an integer or a floating-point raster, or by a feature layer. For a raster barrier, the barrier must have a valid value, including zero, and the areas that are not barriers must be NoData. Syntax: This parameter can have either a raster input or a feature input. For raster input, this parameter can be specified as a portal item ID, a URL to a raster image service layer, a cloud raster dataset, or a shared raster dataset. For feature input, this parameter can be specified as either a URL to a feature service layer or a feature collection. Raster input examples:
Feature input examples:
|
|
A raster defining the elevation values at each cell location. The values are used to calculate the actual surface distance covered when passing between cells. If the input surface raster has a vertical coordinate system (VCS), the values of the surface raster are considered to be in the units of the VCS. If the input surface raster does not have a VCS and the data is projected, the surface values are considered to be in the linear units of the spatial reference. If the input surface raster does not have a VCS and the data is not projected, the surface values are considered to be in meters. Syntax: This parameter can be specified as a portal item ID, a URL to a raster image service layer, a cloud raster dataset, or a shared raster dataset. Examples:
|
|
A raster defining the impedance or cost to move planimetrically through each cell. The values of the cost raster can be integer or floating point. Negative and zero are invalid values but will be treated as very small positive cost values. Cost raster values that are negative or zero are invalid but will be treated as small positive values. The accumulative cost algorithm is a multiplicative process, and it cannot calculate accumulative cost correctly if cost values are negative or zero. If your cost raster does contain those values, and those locations are to represent areas that should be excluded from the analysis, those cells should be turned into NoData before running the tool. Note that NoData is treated as a barrier in this analysis, so any locations that are NoData in the input will be NoData in the result. Syntax: This parameter can be specified as a portal item ID, a URL to a raster image service layer, a cloud raster dataset, or a shared raster dataset. Examples:
|
|
A raster defining the vertical (z) value for each cell. Syntax: This parameter can be specified as a portal item ID, a URL to a raster image service layer, a cloud raster dataset, or a shared raster dataset. Examples:
|
|
Defines the relationship between the vertical cost factor and the vertical relative moving angle. 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 of moving into a neighboring cell. For each factor, a particular selection of characteristic modifiers will apply. See the section below for details on the factor settings and how to set the characteristic modifiers. Values: Characteristics: Zero factor | Low cut angle | High Cut Angle | Slope Syntax: This parameter is a string. Examples:
|
|
A raster defining the horizontal direction at each cell. Syntax: This parameter can be specified as a portal item ID, a URL to a raster image service layer, a cloud raster dataset, or a shared raster dataset. Examples:
|
|
Defines the relationship between the horizontal cost factor and the horizontal relative moving angle. 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 of moving into a neighboring cell. For each factor, a particular selection of characteristic modifiers will apply. See the Horizontal factor additional information section below for details on the factor settings and how to set the characteristic modifiers. Values: Characteristics: Zero factor | Cut angle | Slope | Side value Syntax: The parameter is a string. Examples:
|
|
The output back direction image service name that will be created. The back direction raster contains the calculated direction in degrees. The direction identifies the next cell along the shortest path back to the closest source while avoiding barriers. The range of values is from 0 degrees to 360 degrees, with 0 reserved for the source cells. Due east (right) is 90, and the values increase clockwise (180 is south, 270 is west, and 360 is north). You can specify the name, or you can create an empty service using Portal Admin Sharing API and use the return JSON object as input to this parameter. Syntax: A JSON object describes the name of the output or the output raster. Output name example:
Output raster examples:
|
|
The source direction raster identifies the direction of the least accumulated cost source cell as an azimuth in degrees. The range of values is from 0 degrees to 360 degrees, with 0 reserved for the source cells. Due east (right) is 90, and the values increase clockwise (180 is south, 270 is west, and 360 is north). You can specify the name, or you can create an empty service using Portal Admin Sharing API and use the return JSON object as input to this parameter. Syntax: A JSON object describes the name of the output or the output raster. Output name example:
Output raster examples:
|
|
The source location raster is a multiband output. The first band contains a row index, and the second band contains a column index. These indexes identify the location of the source cell that is the least accumulated cost distance away. You can specify the name, or you can create an empty service using Portal Admin Sharing API and use the return JSON object as input to this parameter. Syntax: A JSON object describes the name of the output or the output raster. Output name example:
Output raster examples:
|
| The starting cost from which to begin the cost calculations. Syntax: This parameter can be specified as a Double value or as a field. Examples:
|
| Defines the maximum accumulative cost of the traveler from a source. Syntax: This parameter can be specified as a Double value or as a field. Examples:
|
| Multiplier to apply to the cost values. Syntax: This parameter can be specified as a Double value or as a field. Examples:
|
|
Defines the direction of the traveler when applying horizontal and vertical factors and the initial accumulation. Syntax: A string describing the optimization method, which can be one of the following:
Example:
|
|
Determines whether the distance will be calculated using a planar (flat earth) or a geodesic (ellipsoid) method.
Example:
|
|
Contains additional settings that affect task processing. This task has the following settings:
|
|
The response format. The default response format is Values: |
Horizontal factor additional information
The following section contains details on the available settings and characteristics of the horizontal
parameter.
In the explanations below, two acronyms are used: HF stands for horizontal factor, which defines the horizontal difficulty encountered when moving from one cell to the next, and 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
Keyword | Description |
---|---|
| Indicates that if the HRMA is less than the cut angle, the HF is set to the value associated with the zero factor; otherwise, it is set to infinity. |
| Establishes that only forward movement is allowed. The HRMA must be greater or equal to 0 and less than 90 degrees (0 <= HRMA < 90). If the HRMA is greater than 0 and less than 45 degrees, the HF for the cell is set to the value associated with the zero factor. If the HRMA is greater than or equal to 45 degrees, the side value modifier value is used. The HF for any HRMA equal to or greater than 90 degrees is set to infinity. |
| Specifies that the HF is a linear function of the HRMA. |
| Specifies that the HF is an inverse linear function of the HRMA. |
| A comma-separated values (CSV) file ( |
Horizontal factor keyword characteristics
Characteristic | Description |
---|---|
Zero factor | Establishes the horizontal factor to be used when the HRMA is zero. This factor positions the y-intercept for any of the horizontal factor functions. |
Cut angle | Defines the HRMA angle beyond which the HF will be set to infinity. |
Slope | Establishes the slope of the straight line used with the |
Side value | Establishes the HF when the HRMA is greater than or equal to 45 degrees and less than 90 degrees when the |
Default values
The default values for the horizontal factor characteristics are as follows:
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 | ~ |
Vertical factor additional information
The following section contains details on the available settings and characteristics of the vertical
parameter.
In the explanations of the vertical factor keywords below, two acronyms are used: VF stands for vertical factor, which defines the vertical difficulty encountered moving from one cell to the next; and 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
Keyword | Description |
---|---|
| Indicates that if the VRMA is greater than the low-cut angle and less than the high-cut angle, the VF is set to the value associated with the zero factor; otherwise, it is infinity. |
| Specifies that the VF is a linear function of the VRMA. |
| Specifies that the VF is a linear function of th VRMA in either the negative or positive side of the VRMA, respectively, and the two linear functions are symmetrical with respect to the VF (y) axis. |
| Specifies that the VF is an inverse linear function of the VRMA. |
| Specifies that the VF is an inverse linear function of the VRMA in either the negative or positive side of the VRMA, respectively, and the two linear functions are symmetrical with respect to the VF (y) axis. |
| Identifies the VF as the cosine-based function of the VRMA. |
| Identifies the VF as the secant-based function of the VRMA. |
| Specifies that the VF is the cosine-based function of the VRMA when the VRMA is negative and the secant-based function of the VRMA when the VRMA is nonnegative. |
| Specifies that the VF is the secant-based function of the VRMA when the VRMA is negative and the cosine-based function of the VRMA when the VRMA is negative. |
| Defines the relationship between the vertical cost factor and the vertical relative moving angle through the reciprocal of Tobler's function, which results in hiking time in hours. |
| Defines the relationship between the vertical cost factor and the vertical relative moving angle through a bidirectional hiking function. |
| A comma-separated values (CSV) file ( |
Vertical factor keyword characteristics
Characteristic | Definition |
---|---|
Zero factor | Establishes the vertical factor to be used when the VRMA is zero. This factor positions the y-intercept of the specified function. By definition, the zero factor is not applicable to any of the trigonometric vertical functions (COS, SEC, COS-SEC, or SEC-COS). The y-intercept is defined by these functions. |
Low cut angle | Defines the VRMA angle below which the VF will be set to infinity. |
High cut angle | Defines the VRMA angle above which the VF will be set to infinity. |
Slope | Establishes the slope of the straight line used with the |
Default values
The default values for the vertical factor characteristics are as follows:
Keywords | Zero factor | Low cut angle | High cut angle | Slope | Power | Cos power | Sec 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 |
Hiking time | ~ | -70 | 70 | ~ | ~ | ~ | ~ |
Bidirectional hiking time | ~ | -70 | 70 | ~ | ~ | ~ | ~ |
Response
When you submit a request, the task assigns a unique job ID for the transaction.
{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}
After the initial request is submitted, you can use the job
to periodically check the status of the job and messages as described in Checking job status. Once the job has successfully completed, you use the job
to retrieve the results. To track the status, you can make a request of the following form:
https://<raster analysis tools url>/DistanceAccumulation/jobs/<jobId>
When the status of the job request is esri
, you can access the results of the analysis by making a request of the following form:
https://<raster analysis tools url>/DistanceAccumulation/jobs/<jobId>/results/<output parameter>
Example usage
Below is a sample request URL for Distance
.
https://services.myserver.com/arcgis/rest/services/System/RasterAnalysisTools/GPServer/DistanceAccumulation/submitJob
JSON Response syntax
The response returns the output
, output
, output
, and output
output parameters, which have properties for parameter name, data type, and value. The content of value is always the item
of the output raster dataset and the image service URL.
{
"paramName": <parameter name>,
"dataType": "GPString",
"value": {
"itemId": <item Id>,
"url": <URL>
}
}
JSON Response example
{
"paramName": "outputDistanceAccumulationRaster",
"dataType": "GPString",
"value": {
"itemId": "f121390b85ef419790479fc75b493efd",
"url": "https://<server name>/arcgis/rest/services/Hosted/<service name>/ImageServer"
}
}