Terrain tiling system / coordinate system

Hi, we're in the middle of adding Cesium terrain support to WhirlyGlobe-Maply and I had a question.

It look as if the terrain tiles coming out of the Cesium server are in a tiling scheme that starts with 2 Y chunks at the lowest level. Are these in Plate Carree (stretched out lat/lon) as well?

It also looks like you're draping those on top of Bing imagery, which I believe is spherical mercator (ish). There's also an example of Mapbox imagery, which is definitely web mercator.

So, are you slicing and dicing the imagery to match the elevation tiles?

If so, are there are any imagery sources out there with a direct mapping to your terrain tiling scheme?

For that matter, are there any Cesium terrain examples that are pure web mercator with the regular TMS tiling scheme?

I notice the terrain generation tools have some flexibility in that area, so we can probably generate a tiling scheme to match what we need. I'd just like to test against something before going down that path.

-thanks
Steve Gifford
(mousebird consulting inc)

Hey Steve,

Cesium supports two terrain formats, one raster based, and one quantized mesh.

Have you seen the docs for both here: http://cesiumjs.org/data-and-assets/terrain/formats/quantized-mesh-1.0.html

http://cesiumjs.org/data-and-assets/terrain/formats/heightmap-1.0.html

?

Hey Steve,

Cesium supports two terrain formats, one raster based, and one quantized mesh.

Have you seen the docs for both here: http://cesiumjs.org/data-and-assets/terrain/formats/quantized-mesh-1.0.html

http://cesiumjs.org/data-and-assets/terrain/formats/heightmap-1.0.html

?

Indeed it does and indeed, those are the (excellent) documentation pages.

My question was related to the tiling system used by the Cesium terrain service. It appears to be a two-headed quad tree. Or a truncated quad-tree with a missing head and two empty entries at the second level if you want to look at it that way. In any case, it doesn’t correspond to any of the more common tiling schemes out there for imagery.

I suspect the answers to my questions are: Yes. Yes. Maybe. No.

So the one I’m really hoping for now, is: Are there any tiled image sources with a 1:1 correspondence to the Cesium terrain tiles. This would allow us to overlay tile 0/1/0.terrain with 0/1/0.jpg and not do the rescaling/slicing that CesiumJS is apparently doing.

Longer term, I suspect we could run off our own terrain database with the Cesium tools in the Web Mercator TMS quad-tree we need. But short term I just want to get something working so the client can decide how they like Cesium terrain on mobile devices.

-Steve G

(mousebird consulting inc)

Hi Steve,

STK World Terrain uses a standard tiling scheme for geographic / Plate Carre / EPSG:4326 tiling, which has two tiles at the root, each of which is a root of a quadtree pyramid. It can also use this tiling scheme for imagery if desired. Cesium does support the more-common-on-the-web Web Mercator scheme for imagery, of course, and also for terrain. We don’t typically use it for terrain, though, because the Web Mercator projection only extends to about 85 degrees latitude, so there will be holes with no geometry at the North and South poles. Cesium has a trick (screen space pole filling) to hide this, but it’s imperfect.

This presentation (PDF / PPTX) has a lot of details about how this all works. The part you’re most interested in starts around slide 32.

Kevin

Thanks, that was quite helpful. I think I’ve got a good sense of what the terrain server is doing with its tiling.

One last question. Do you know of any imagery sources that map 1:1 to the terrain tiling scheme?

I ask because we’re putting together an example for a client and I’d like to show them the Cesium terrain in the best possible light. If they like it we’ll probably run off a version of their own in Web mercator to match their Mapbox sources.

Resampling like you do is not something I’d really want to do on mobile devices. It’s clever, certainly, and I like the idea of handling multiple tiling schemes, but it’s a significant battery drain. Perhaps in the future…

-thanks

Steve G

(mousebird consulting inc)

There are certainly imagery sources that use EPSG:4326. I was going to point you to the AGI-hosted Black Marble tiles, but they seem to be down right now.

In any case, I expect the performance / battery loss from reprojection and multitexturing to be pretty small, even on mobile. Your demo is likely to be much more impressive with good imagery, and I don’t know of any that are good as Bing Maps and that use EPSG:4326.

Kevin

The blackmarble is working fine on my end: http://cesiumjs.org/blackmarble/tilemapresource.xml

Sandcastle: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Imagery%20Layers.html&label=All

The page on cesiumjs.org lists a different URL, which doesn’t work:
http://cesiumjs.org/data-and-assets/imagery/black-marble.html