Get elevation at a point

View inMAUIUWPWPFWinUIView on GitHub

Get the elevation for a given point on a surface in a scene.

Image of get elevation at point

Use case

Knowing the elevation at a given point in a landscape can aid in navigation, planning and survey in the field.

How to use the sample

Tap anywhere on the surface to get the elevation at that point. Elevation is reported in meters since the scene view is in WGS84.

How it works

  1. Create a SceneView and Scene with an imagery base map.
  2. Set an ArcGISTiledElevationSource as the elevation source of the scene's base surface.
  3. Use the GetElevationAsync(surfacePoint) method on the base surface to asynchronously get the elevation.

Relevant API

  • ArcGISTiledElevationSource
  • BaseSurface
  • ElevationSourcesList
  • SceneView

Additional information

GetElevationAsync(surfacePoint) retrieves the most accurate available elevation value at a given point. To do this, the method must go to the server or local raster file and load the highest level of detail of data for the target location and return the elevation value.

If multiple elevation sources are present in the surface, the top most visible elevation source with a valid elevation in the given location is used to determine the result.

Tags

elevation, point, surface

Sample Code

GetElevationAtPoint.xamlGetElevationAtPoint.xamlGetElevationAtPoint.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<UserControl
    x:Class="ArcGIS.UWP.Samples.GetElevationAtPoint.GetElevationAtPoint"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="using:Esri.ArcGISRuntime"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid>
        <esriUI:SceneView x:Name="MySceneView" />
        <Border Style="{StaticResource BorderStyle}">
            <TextBlock Text="Tap to find the elevation for a point."
                       TextAlignment="Center" TextWrapping="Wrap" FontWeight="SemiBold" />
        </Border>
    </Grid>
</UserControl>

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