Create Viewshed

Create Viewshed

The Create Viewshed task identifies visible areas based on the observer locations you provide. The results are areas where the observers can see the observed objects (and the observed objects can see the observers).

This task is a wrapper around the Viewshed task found in Elevation Analysis Services. The main difference between these two tasks is that Create Viewshed provides for feature service layers as input and output.

Request URL

Use dark colors for code blocksCopy
1
http://<analysis url>/CreateViewshed/submitJob

Request Parameters

ParameterDescription

inputLayer (Required)

The features to use as the observer locations.

Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:

  • A URL to a feature service layer with an optional filter to select specific features
  • A feature collection

Examples:

  • {"url": <feature service layer url>, "filter": <where clause>}
  • {"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}

demResolution

The approximate spatial resolution (cell size) of the source elevation data used for the calculation.

The default is the finest resolution available.

The resolution values are an approximation of the spatial resolution of the digital elevation model. While many elevation sources are distributed in units of arc seconds, the keyword is an approximation of those resolutions in meters for easier understanding.

  • Type: String

  • Values: FINEST | 10m | 24m | 30m | 90m
  • Default: Finest

maximumDistance

This is a 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.

It is useful for modeling current weather conditions or a given time of day, such as dusk. Large values increase computation time.

Unless specified, a default maximum distance will be computed based on the resolution and extent of the source DEM. The allowed maximum value is 50 kilometers.

Use maxDistanceUnits to set the units for maximumDistance.

  • Type: Double

maxDistanceUnits

The units for the maxDistance parameter.

  • Type: String

  • Values: Meters | Kilometers | Feet | Yards | Miles

  • Default: Meters

observerHeight

This is the height above the ground of the observer locations.

The default is 1.75 meters, which is approximately the average height of a person. If you are looking from an elevated location, such as an observation tower or a tall building, use that height instead.

Use observerHeightUnits to set the units for observerHeight.

  • Type: Double

  • Default: 1.75

observerHeightUnits

The units for the observerHeight parameter.

  • Type: String

  • Values: Meters | Kilometers | Feet | Yards | Miles

  • Default: Meters

targetHeight

This is the height of structures or people on the ground used to establish visibility. The result viewshed are those areas where an input point can see these other objects. The converse is also true; the other objects can see an input point.

  • If your input points represent wind turbines and you want to determine where people standing on the ground can see the turbines, enter the average height of a person (approximately 6 feet). The result is those areas where a person standing on the ground can see the wind turbines.
  • If your input points represent fire lookout towers and you want to determine which lookout towers can see a smoke plume 20 feet high or higher, enter 20 feet for the height. The result is those areas where a fire lookout tower can see a smoke plume at least 20 feet high.
  • If your input points represent scenic overlooks along roads and trails and you want to determine where wind turbines 400 feet high or higher can be seen, enter 400 feet for the height. The result is those areas where a person standing at a scenic overlook can see a wind turbine at least 400 feet high.
  • If your input points represent scenic overlooks and you want to determine how much area on the ground people standing at the overlook can see, enter zero. The result is those areas that can be seen from the scenic overlook.

Use targetHeightUnits to set the units for targetHeight.

  • Type: Double

  • Default: 0.0

targetHeightUnits

The units for the targetHeight parameter.

  • Type: String

  • Values: Meters | Kilometers | Feet | Yards | Miles

  • Default: Meters

generalize

Determines whether the viewshed polygons are to be generalized.

The viewshed calculation is based on a raster elevation model that creates a result with stair-stepped edges. To create a more pleasing appearance and improve performance, the default behavior is to generalize the polygons. The generalization process smooths the boundary of the visible areas and may remove some single-cell visible areas.

  • Type: Boolean
  • Values: true | false
  • Default: True

outputName

If provided, the task will create a feature service of the results. You define the name of the service. If an outputName value is not provided, the task will return a feature collection.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "serviceProperties": {
    "name": "<service name>"
  }
}

In ArcGIS Online or ArcGIS Enterprise 10.9.1 and later, you can overwrite an existing feature service by providing the itemId value of the existing feature service and setting the overwrite property to true. Including the serviceProperties parameter is optional. As described in the Feature output topic, you must either be the owner of the feature service or have administrative privileges to perform the overwrite.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{

  "itemProperties": {
			"itemId": "<itemID of the existing feature service>",
			"overwrite": true
	}
}

or

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
{
"serviceProperties": {
    "name": "<existing service name>"
  },
"itemProperties": {
				"itemId": "<itemID of the existing feature service>",
				"overwrite": true
	}
}

context

The Context parameter contains the following additional settings that affect task operation:

  • Extent (extent)—A bounding box that defines the analysis area. Only input features that intersect the bounding box will be analyzed.
  • Output spatial reference (outSR)—The output features will be projected into the output spatial reference.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
{
  "extent" : {extent},
  "outSR" : {spatial reference}
}

f

The response format. The default response format is html.

Values: html | json

Response

When you submit a request, the request assigns a unique job ID for the transaction.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
{
"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 the topic Check job status. Once the job has successfully completed, you use the jobId to retrive the results. To track the status, you can make a request of the following form:

Use dark colors for code blocksCopy
1
http://<analysis url>/CreateViewshed/jobs/<jobId>

Accessing results

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:

Use dark colors for code blocksCopy
1
http://<analysis url>/jobs/<jobId>/results/viewshedLayer?token=<your token>&f=json
ParameterDescription

viewshedLayer

The viewshed polygons. Example:

Use dark colors for code blocksCopy
1
{"url":"http://<analysis url>/CreateViewshed/jobs/<jobId>/results/viewshedLayer"}

The result has properties for parameter name, data type, and value. The contents of value depends upon the outputName parameter provided in the initial request.

  • If outputName was provided, value contains the url to the feature service layer.
Use dark colors for code blocksCopy
1
2
3
4
5
{
"paramName":"viewshedLayer",
"dataType":"GPString",
"value":{"url":"<hosted featureservice layer url>"}
}
  • If outputName was not provided, value contains a feature collection.
Use dark colors for code blocksCopy
1
2
3
4
5
{
"paramName":"viewshedLayer",
"dataType":"GPString",
"value":{"layerDefinition": {}, "featureSet": {}  }
}

See Feature Output for more information about how the result layer or collection is accessed.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.