I added raster layer to scene by using code below:
Raster myRaster = new Raster(.../myDoc.tif);
RasterLayer newRasterLayer = new RasterLayer(myRaster);
MySceneView.Scene.OperationalLayers.Add(newRasterLayer);
Then tried to get elevation by using MySceneView.Scene.BaseSurface.GetElevationAsync(e.Location);
But it returns 0 for all points at scene.
Then I changed my code to:
Raster myRaster = new Raster(.../myDoc.tif);
var elev = new ArcGISTiledElevationSource(new Uri(.../myDoc.tif));
RasterLayer newRasterLayer = new RasterLayer(myRaster);
MySceneView.Scene.BaseSurface.ElevationSources.Add(elev);
MySceneView.Scene.OperationalLayers.Add(newRasterLayer);
But result did not change, I still get 0 from MySceneView.Scene.BaseSurface.GetElevationAsync(e.Location);
Can anybody write where I make mistake?
Solved! Go to Solution.
Hi.
You should use a RasterElevationSource rather than an ArcGISTiledElevationSource.
Of course, your myDoc.tif file should be suitable for use as an elevation source.
Once you've done that, do double-check that the Scene's BaseSurface has IsEnabled set to true.
Does that help?
By the way, I am working with offline scene
Hi.
You should use a RasterElevationSource rather than an ArcGISTiledElevationSource.
Of course, your myDoc.tif file should be suitable for use as an elevation source.
Once you've done that, do double-check that the Scene's BaseSurface has IsEnabled set to true.
Does that help?
Thanks for your help. That worked for me