Terrain Elevation with ArcGIS Tiled Elevation Terrain

143 views
Skip to first unread message

jyas...@nextgenfed.com

unread,
Jul 11, 2019, 10:50:09 AM7/11/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.

Unable to retrieve terrain height at a position using sampleTerrain. May be unsupported? Looking for a work around.


2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
Paste into sandcastle

var viewer = new Cesium.Viewer('cesiumContainer', {

});

var terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({
url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer'
});

terrainProvider.readyPromise.then(function(isReady){
console.log('Ready:'+isReady);
viewer.terrainProvider = terrainProvider;

var samplePos = [
Cesium.Cartographic.fromDegrees(-77.134487059577509, 38.6777220281884)
];

var promise = Cesium.sampleTerrain(viewer.terrainProvider, 15, samplePos);
promise.then(function(promise){
console.log('Latitude:' + Cesium.Math.toDegrees(samplePos[0].latitude));
console.log('Longitude:' + Cesium.Math.toDegrees(samplePos[0].longitude));
console.log('Height:' + samplePos[0].height);
});
});


3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

Need to gather terrain heights at specific locations. Workarounds are acceptable

4. The Cesium version you're using, your operating system and browser.
1.59
Sandcastle ArcGIS Tiled Elevation Terrain Example

Omar Shehata

unread,
Jul 16, 2019, 3:52:38 PM7/16/19
to cesium-dev
I believe this is a bug - I posted some of my debugging notes here and pinged Tom Fili who might have a better idea where the issue is:

Reply all
Reply to author
Forward
0 new messages