I have successfully computed the height of a location where user clicks in cesium but my next step is a bit complex. What i want to do is that when user clicks at some point on globe, at any zoom level, i want to calculate highest point, lowest point and, average altitude around click position (say a circular area of 1000 meters). How should I do it, any ideas?
I solved this problem by finding all LatLngs in a square region using bi-linear interpolation and then used Cesium's sample terrain to query height info for each point. Following are the steps I followed:
var northwest = google.maps.geometry.spherical.computeOffset(center, radius * Math.sqrt(2.0), 135);
var northeast = google.maps.geometry.spherical.computeOffset(center, radius * Math.sqrt(2.0), 45);
var southwest = google.maps.geometry.spherical.computeOffset(center, radius * Math.sqrt(2.0), 225);
var southeast = google.maps.geometry.spherical.computeOffset(center, radius * Math.sqrt(2.0), 315);
interpolate
method for avoiding extra work.Like this: google.maps.geometry.spherical.interpolate(latlng1, latlng2, fraction);