Select to view content in your preferred language

How to use elevation data in a MapView?

4119
13
02-16-2018 01:43 AM
OliverBoesche
Emerging Contributor

Hi,

I currently try to load DTED files in an offline application using the MapView, but found no way to get values from the DTED files. The following example shows my current approach. Rendering the DTED files with a Hillshade-Renderer is successfull. Therefore, it is simple to see where elevation data should be available.

private async void Initialize()

{

var elevationFileList = new List<string>()

       {

@"C:\tmp\example.dt0",

@"C:\tmp\example.dt1",

@"C:\tmp\example.dt2"

      };

 

this.surface = new Surface();

var rasterElevation = new RasterElevationSource(elevationFileList);

await rasterElevation.LoadAsync();

this.surface.ElevationSources.Add(rasterElevation);

await this.surface.LoadAsync();

}

 

 

private async void MapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)

{

var altitude = await this.surface.GetElevationAsync(e.Location);

System.Console.WriteLine("Altitude:{0}", altitude);

}

As far as I understand the documentation it is only possible to use the elevation data when it is bound to a surface on a SceneView. I would appreciate every hint to find a solution for this problem.

Best regards,
Oliver

0 Kudos
13 Replies
BikeshMaharjan1
Regular Contributor

Hey Keith,

Does this still work with 100.4.0? It used to work for me in previous versions but now, it freezes unless i put some delay before calling

GetElevationAsync(point);
0 Kudos
BjørnarSundsbø1
Frequent Contributor

I've been able to make this work in 100.4. My short recipe is:

- Load WebScene from portal

- Iterate and LoadAsync on scene.BaseSurfaces.ElevationSources

- await scene.BaseSurface.GetElevationAsync(point)

0 Kudos
KeithGemeinhart1
Regular Contributor

Yes, still working for me in 100.4. Sounds like you might have something else causing your problem.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

The current release of ArcGIS Runtime (100.8) now includes support for identifying cell/pixel values from raster data.

Welcome to ArcGIS Runtime 100.8 

Thanks

Mike

0 Kudos