Analyze the exploratory viewshed for an object (GeoElement) in a scene.

Use case
An exploratory viewshed analysis is a type of visual analysis you can perform at the current rendered resolution of a scene. The exploratory viewshed aims to answer the question ‘What can I see from a given location?’. The output is an overlay with two different colors - one representing the visible areas (green) and the other representing the obstructed areas (red).
Note: This analysis is a form of “exploratory analysis”, which means the results are calculated on the current scale of the data, and the results are generated very quickly but not persisted. If persisted analysis performed at the full resolution of the data is required, consider using a ViewshedFunction to perform a viewshed calculation instead.
How to use the sample
Tap to set a destination for the vehicle (a GeoElement). The vehicle will ‘drive’ towards the tapped location. The exploratory viewshed analysis will update as the vehicle moves.
How it works
- Create and show the scene, with an elevation source and a buildings layer.
- Add a model (the
GeoElement) to represent the observer (in this case, a tank).- Use a
SimpleRendererwhich has a heading expression set in theGraphicsOverlay. This way you can relate the viewshed’s heading to theGeoElementobject’s heading.
- Use a
- Create an
ExploratoryGeoElementViewshedwith configuration for the viewshed analysis. - Add the viewshed to an
AnalysisOverlayand add the overlay to the scene. - Configure the SceneView
CameraControllerto orbit the vehicle.
Relevant API
- AnalysisOverlay
- ExploratoryGeoElementViewshed
- GeodeticDistanceResult
- ModelSceneSymbol
- OrbitGeoElementCameraController
- static GeometryEngine.geodeticDistance(from:to:distanceUnit:azimuthUnit:curveType:)
About the data
This sample shows buildings in Brest, France Scene from ArcGIS Online. The sample uses a Tank model scene symbol hosted as an item on ArcGIS Online.
Tags
3D, analysis, buildings, exploratory viewshed, model, scene, visibility analysis