Analyze viewshed

This sample demonstrates how to use GeoprocessingTask to calculate a viewshed using a geoprocessing service. Click any point on the map to see all areas that are visible within a 1 kilometer radius. It may take a few seconds for the model to run and send back the results.

Analyze viewshed result

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.AnalyzeViewshed.AnalyzeViewshed"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <esri:MapView x:Name="MyMapView" />
        <Border
                Background="White" BorderBrush="Black" BorderThickness="1"
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Margin="30" Width="375">
            <Grid Margin="20">
                <TextBlock Text="Click map to execute viewshed analysis." 
                           HorizontalAlignment="Center" VerticalAlignment="Center" />
            
                <Grid x:Name="busyOverlay" Margin="-20" Visibility="Collapsed" Background="#8C000000" Grid.RowSpan="4">
                    <Border HorizontalAlignment="Center" VerticalAlignment="Center" Padding="10" Background="#FFC6C4C4">
                        <Grid>
                            <ProgressBar IsIndeterminate="True" x:Name="progress" Height="20" />
                            <TextBlock Text="Executing analysis..." HorizontalAlignment="Center" Margin="5" Height="20" />
                        </Grid>
                    </Border>
                </Grid>
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code