'Hiding' errors from faulty sampleTerrains.

Hi there,

First off; let me apologize for first asking this question on the issues of Github. It was a bit of a hurried question, however it's fine for now.

I've written a script that samples the terrain to get the 'appropriate' zoomlevel for the final sampleTerrain function, starting from zoomlevel 15.

Now, this works great. I get the correct zoomlevels for the tiles I'm on (f.e. - Netherlands generally returns '14' as the highest zoomlevel. But if I go to Mirny Mine, it will return '9'.).

However what this does do is that it throws quite a lot of errors (for the lower detail levels ofcourse a larger amount due to the fact that multiple sampleterrains are ran.). Is there a way to catch these by myself instead of having the sampleTerrain function itself throw the errors?

Kind regards,

Heerco Grond

Hi Heerco,

Thanks for reposting your question in the forum =) It helps get the answer out there to more people who may have the same question.

I think the changes in this pull request might help you: https://github.com/AnalyticalGraphicsInc/cesium/pull/3396/files

The pull request includes a function to sample terrain at the most detailed level. This way you can sample terrain at the highest level of detail without having to catch any errors.



Hi Hannah,

any idea when this pull request will be merged? I’d need this as well to properly clamp GPS tracks to the ground like here: https://ppc.paralog.net/showDetailedTrack.php?trackid=16638


Hello Klaus,

I don’t know exactly when it will be merged, but we’re trying to get it moving and figure out what else needs to be done before it’s ready. I’ll post here when it’s merged.



Hi folks,

We just merged #3396, which contains the new sampleTerrainMostDetailed function, into master. It will be in the Cesium 1.30 release on February 1.


Great! Exactly what I needed.