Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating terrain tiles for a local area #1

Closed
turban opened this issue Sep 22, 2014 · 3 comments
Closed

Creating terrain tiles for a local area #1

turban opened this issue Sep 22, 2014 · 3 comments

Comments

@turban
Copy link

turban commented Sep 22, 2014

Great work!

I've tested the terrain builder and created a tileset for an area in Norway. I also had to create a layer.json file. I'm then adding the terrain with these lines:

  var terrainProvider = new Cesium.CesiumTerrainProvider({
    url: '/terrain/jotunheimen'
  });

  viewer.scene.terrainProvider = terrainProvider;

I'm getting this error:

Failed to obtain terrain tile X: 0 Y: 0 Level: 0

This tile don't exist as it's not where my data is. I'm getting the same error if I first move to my location:

viewer.scene.camera.flyTo({
  destination: Cesium.Cartesian3.fromDegrees(8.4, 61.5, 10000.0),
  duration: 3,
  complete: switchTerrain
});

Do you now how to load terrain tiles for a local area?

@homme
Copy link
Member

homme commented Sep 22, 2014

I've come across this issue before: it seems that CesiumJS always needs to request the two top level tiles (0/0/0.terrain & 0/1/0.terrain). If your underlying GDAL dataset doesn't overlap the prime meridian then one of those tiles will be missing; if you're rendering Norway it makes sense that it can't find the 0/0/0.terrain tile.

I fixed this by manually copying a terrain tile that happened to be blank to the appropriate place in the terrain output (0/0/0.terrain). You could also get this tile from http://cesiumjs.org/tilesets/terrain/smallterrain/0/0/0.terrain. The only slight problem is that this latter tile will specify the existence of child tiles which won't of course exist, but this is only an optimisation issue really.

It may be worth me adding an option to ctb-tile to control the generation of this top level tile (by default).

@turban
Copy link
Author

turban commented Sep 22, 2014

Thanks for your quick reply! I also read about it here:
https://groups.google.com/forum/#!msg/cesium-dev/apE83KFxYW8/1xJ5P0qlvNYJ

Do you have an empty tile (with no child tiles) that you could attach to this issue?

homme pushed a commit that referenced this issue Sep 22, 2014
Unless the GDAL dataset passed to `ctb-tile` crosses the Prime Meridian one of
either of the root tiles `/0/0/0.terrain` or '/0/0/1.terrain` will be missing.
However, both tiles are required by CesiumJS.  The added tile specifies no child
tiles and can be manually added to the appropriate root tile in a tileset in
order to resolve the problem. See issue #1 for details.
@homme
Copy link
Member

homme commented Sep 22, 2014

No problem. The blank tile is available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants