Basically I want to calculate the location which has max height terrain of the selected area. Area is selecting by drawing a polygon.
I understand that we can get actual terrain height with the help of Cesium.sampleTerrainMostDetailed
So to pass coordinates array sampleTerrainMostDetailed, first I need to calculate all the possible coordinates present inside the drawn polygon.
var viewer = new Cesium.Viewer('cesiumContainer');
var bluePolygon = viewer.entities.add({
name : 'Blue polygon',
polygon : {
hierarchy : {
positions : Cesium.Cartesian3.fromDegreesArray([-99.0, 30.0,
-85.0, 30.0,
-85.0, 40.0,
-99.0, 40.0]),
},
material : Cesium.Color.BLUE.withAlpha(0.5),
height : 0,
outline : true // height is required for outline to display
}
});
console.log(JSON.stringify(bluePolygon.polygon.hierarchy.valueOf()));
viewer.zoomTo(viewer.entities);
In short, I want to collect all the possible coordinates which are present inside a polygon to pass them in sampleTerrainMostDetail function to know which coordinate has max height.
Sandcastle link
Regards,
- Jacky