Viewshed for GeoElement
Analyze the viewshed for an object (GeoElement) in a scene.
A viewshed analysis is a type of visual analysis you can perform on a scene. The 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).
Tap to set a destination for the vehicle (a GeoElement). The vehicle will 'drive' towards the tapped location. The viewshed analysis will update as the vehicle moves.
- 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 the
GraphicsOverlay. This way you can relate the viewshed's heading to the
- Use a
- Create a
GeoElementViewshedwith configuration for the viewshed analysis.
- Add the viewshed to an
AnalysisOverlayand add the overlay to the scene.
- Configure the SceneView
CameraControllerto orbit the vehicle.
This sample downloads the following items from ArcGIS Online automatically:
- bradley_low_3ds.zip - Model Scene Symbol for use in ArcGIS Runtime Samples
3D, analysis, buildings, model, scene, viewshed, visibility analysis
<?xml version="1.0" encoding="utf-8" ?> <ContentPage x:Class="ArcGISRuntime.Samples.ViewshedGeoElement.ViewshedGeoElement" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"> <StackLayout Orientation="Vertical"> <Label Text="Tap to set a destination for the vehicle." VerticalOptions="Start" /> <esriUI:SceneView x:Name="MySceneView" VerticalOptions="FillAndExpand" /> </StackLayout> </ContentPage>