How to find elevation profile of a polyline graphic (v100.0,WPF)?

Discussion created by keith.gemeinhart on Mar 31, 2017
Latest reply on Apr 5, 2017 by twakim-esristaff

Working with .NET Runtime v100.0 and a WPF desktop application ... I'd like to be able to draw an elevation profile that corresponds to a graphic that I've drawn on a map. Additionally, I'd like to inspect the line to find the elevation at any point along the line. Any help for these two items would be appreciated.


Here is what I have so far:

// Create a raster elevation source based on all files in dted1Files
RasterElevationSource dted1ElevSource = new RasterElevationSource(Dted1Files);
await dted1ElevSource.LoadAsync();
dted1ElevSource.Name = "DTED1";

// Create a Surface based on the elevation source
Dted1Surface.Name = "DTED1 Surface";
await Dted1Surface.LoadAsync();

// Create a Scene and assign the created surface to its BaseSurface
Scene dted1Scene = new Scene();
dted1Scene.BaseSurface = Dted1Surface;
await dted1Scene.LoadAsync();

// Create a SceneView and assign created scene to its Scene
SceneView1.Scene = dted1Scene;


Then I can get elevation at any particular point via:   

 result = await Dted1Surface.GetElevationAsync(point);


I tried this, but the Z values are all zero:

var drapedOverlay = new GraphicsOverlay();
drapedOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Draped;

// existing polyline on a map layervar
var hose = hoselineLayer.Graphics.FirstOrDefault();

hose3d = new Graphic(hose.Geometry);