- URL:https://<rasteranalysistools-url>/CreateViewshed
- Version Introduced:10.5
Description
The CreateViewshed task uses an elevation surface and observer locations to identify areas where the observers can see the observed objects and the observed objects can see the observers.
Request parameters
The following table lists the parameters with syntax and details for each:
Parameter | Details |
---|---|
inputElevationSurface (Required) | The input elevation surface for calculating the viewshed. 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:
|
inputObserverFeatures (Required) | The input observer locations features. Syntax: This parameter can be specified as a URL to a feature service layer with an optional filter to select specific features, or a feature collection. Input feature examples:
|
outputName (Required) | The name of the output image service that will be created. 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:
|
optimizeFor | Specifies the optimization method that will be used to calculate the viewshed. The options are as follows:
Syntax: A string describing the optimization method. Example:
|
maximumViewingDistance | The cutoff distance where the computation of visible areas stops. Beyond this distance, it is unknown whether the analysis points and the other objects can see each other. The value must be supplied through either the maximumViewingDistance parameter or the maximumViewingDistanceField parameter. Syntax: A linear unit specifying the distance and units. Supported units: Meters | Kilometers | Feet | Yards | Miles | FeetInt | YardsInt | MilesInt Example:
|
maximumViewingDistanceField | A field that specifies the maximum viewing distance for each observer. You can use any numerical field from the input observer point features. The value contained in this field must be in the same unit as the x,y unit of the input elevation surface. Syntax: A string that represents a field name. Example:
|
minimumViewingDistance | The distance where the computation of visible areas begins. The value must be supplied through either the minimumViewingDistance parameter or the minimumViewingDistanceField parameter. Syntax: A linear unit specifying the distance and units. Supported units: Meters | Kilometers | Feet | Yards | Miles | FeetInt | YardsInt | MilesInt Example:
|
minimumViewingDistanceField | A field that specifies the minimum viewing distance for each observer. You can use any numerical field from the input observer point features. The value contained in this field must be in the same unit as the x,y unit of the input elevation surface. Syntax: A string that represents a field name. Example:
|
viewingDistanceIs3D | Specifies whether the minimumViewingDistance and maximumViewingDistance input parameters will be measured in a three-dimensional or two-dimensional way. Syntax: A Boolean value as either true or false.
|
observersElevation | The elevation of the observer locations. The value must be supplied through either the observersElevation parameter or the observersElevationField parameter. Syntax: A linear unit specifying the elevation and units. Supported units: Meters | Kilometers | Feet | Yards | Miles | FeetInt | YardsInt | MilesInt Example:
|
observersElevationField | A field that specifies the elevation for the observers. You can use any numerical field from the input observer point features. The value contained in this field must be in the same unit as the z-unit of the input elevation surface. Syntax: A string that represents a field name. Example:
|
observersHeight | The height above ground of the observer locations. The value must be supplied through either the observersHeight or observersHeightField parameters. During the viewshed calculation, this value is added to the observer elevation if it is specified; otherwise, it is added to the interpolated surface z-value. Syntax: A linear unit specifying the height and units. Supported units: Meters | Kilometers | Feet | Yards | Miles | FeetInt | YardsInt | MilesInt Example:
|
observersHeightField | A field that specifies the height for the observers. You can use any numerical field from the input observer point features. The value contained in this field must be in the same unit as the z-unit of the input elevation surface. Syntax: A string that represents a field name. Example:
|
targetHeight | The height of structures, or people on the ground, that will be used to establish visibility. The value must be supplied through either the targetHeight parameter or the targetHeightField parameter. Syntax: A linear unit specifying the height and units. Supported units: Meters | Kilometers | Feet | Yards | Miles | FeetInt | YardsInt | MilesInt Example:
|
targetHeightField | A field that specifies the height for the targets. You can use any numerical field from the input observer point features. The value contained in this field must be in the same unit as the z-unit of the input elevation surface. Syntax: A string that represents a field name. Example:
|
aboveGroundLevelOutputName | The optional above ground level output image service name. 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:
|
verticalError | The amount of uncertainty (the root mean square error, or RMS error) in the surface elevation values. It is a linear unit value representing the expected error of the input elevation values. Syntax: A linear unit specifying the vertical error. Supported units: Meters | Kilometers | Feet | Yards | Miles | FeetInt | YardsInt | MilesInt Example:
|
refractivityCoefficient | The coefficient of the refraction of visible light in air. Syntax: A numerical value specifying the refractivity coefficient. Example:
|
horizontalStartAngle | The start angle of the horizontal scan range. The value is specified in degrees from 0 to 360, either as integer or floating point, with 0 oriented to north. You can select a field in the input observers dataset, or you can specify a numerical value. Syntax: A string that represents a field name or a numerical value. Example:
|
horizontalEndAngle | The end angle of the horizontal scan range. The value is specified in degrees from 0 to 360, either as integer or floating point, with 0 oriented to north. You can select a field in the input observers dataset, or you can specify a numerical value. Syntax: A string that represents a field name or a numerical value. Example:
|
verticalUpperAngle | The upper vertical angle limit of the scan relative to the horizontal plane. The value is specified in degrees and can be integer or floating point. The allowed range is from above -90 up to and including 90. You can select a field in the input observers dataset, or you can specify a numerical value. Syntax: A string that represents a field name or a numerical value. Example:
|
verticalLowerAngle | The lower vertical angle limit of the scan relative to the horizontal plane. The value is specified in degrees and can be integer or floating point. The allowed range is from above -90 up to and including 90. You can select a field in the input observers dataset, or you can specify a numerical value. Syntax: A string that represents a field name or a numerical value. Example:
|
context | Contains additional settings that affect task processing. This task has the following settings:
|
f | The response format. The default response format is html. Values: html | json | pjson |
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 jobId 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 jobId to retrieve the results. To track the status, you can make a request of the following form:
https://<raster analysis tools url>/CreateViewshed/jobs/<jobId>
When the status of the job request is esriJobSucceeded, you can access the results of the analysis by making a request of the following form:
https://<raster analysis tools url>/CreateViewshed/jobs/<jobId>/results/<output parameters>
Example usage
The following is a sample request URL for CreateViewshed:
https://services.myserver.com/arcgis/rest/services/System/RasterAnalysisTools/GPServer/CreateViewshed/submitJob
JSON Response syntax
The response returns the outputRaster output parameter, which has properties for parameter name, data type, and value. The content of value is always the output raster dataset itemId and the image service URL.
{
"paramName": <parameter name>,
"dataType": "GPString",
"value": {
"itemId": <item Id>,
"url": <URL>
}
}
JSON Response example
{
"paramName": "outRaster",
"dataType": "GPString",
"value": {
"itemId": "f121390b85ef419790479fc75b493efd",
"url": "https://<server name>/arcgis/rest/services/Hosted/<service name>/ImageServer"
}
}