Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

tile scheme #99

Open
ltclm opened this issue Jul 30, 2015 · 5 comments
Open

tile scheme #99

ltclm opened this issue Jul 30, 2015 · 5 comments
Assignees
Labels

Comments

@ltclm
Copy link
Contributor

ltclm commented Jul 30, 2015

why is our tile adressing scheme different from the default tms scheme described here:
http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/

The viewer on this page shows the last tile which fully contains switzerland has the address:
TMS: 6,33,41
Google: 6,33,22

In our scheme the corresponding tile has the address: 5,33,7
i know the y value in the cesium debug mode is wrong (top left origin instead of bottom left origin).
Where is the offset in the z-value coming from?

@gjn
Copy link

gjn commented Jul 30, 2015

AFAIK, we take our pyramid for global_geodetic, which is taken from gdal: https://github.com/geoadmin/3d-forge/blob/master/forge/lib/global_geodetic.py

@ltclm ltclm added question and removed bug labels Jul 30, 2015
@loicgasser
Copy link
Contributor

AFAIK Google is using spherical mercator (EPSG 900913) with WGS84 datum, so projected on a sphere rather than a ellipsoid like we do with EPSG:4326. We can acutally generate both, we just need to change the tiling scheme.

@loicgasser
Copy link
Contributor

Sorry misread the question. For y it is apparently a cesium issue: https://github.com/geoadmin/3d-testapp/pull/7
For z we start at 0 they start at 1 I guess.

@thiloSchlemmer
Copy link

Hi there.
i'm trying to produce quantized-mesh tiles and deliver the tiles with geo-data/cesium-terrain-server.
But i stumble over the tiling scheme in cesium. i saw, that the file 3d-forge/configs/terrain/layer.json uses the before mentioned different tiling scheme. Why is the y-value different to TMS and Google? Is there a way to transform from TMS?

@loicgasser
Copy link
Contributor

Actually TMS specifications put the origin at the bottom left and not at top left like Google.
Starting with 2 tiles at beginning, you see it for yourself here :
https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic

Cesium seems to implement exactly this spec per defaut with y pointing up. You can use the GlobalGeodetic class in this project to generate the grid or use directly the one in quantized-mesh-tile library.

You can use the GlobalGeodetic
https://quantized-mesh-tile.readthedocs.io/en/latest/tutorial.html#read-a-local-terrain-tile
Or via mapproxy or even this pypi module
https://github.com/geoadmin/gatilegrid
(you can choose y pointing down or up)

The layers.json file is used to restrict the extent of your terrain and configure the tile adresses. It can be generated using
https://github.com/geoadmin/3d-forge/blob/master/forge/layers/metadata.py

And
https://github.com/geoadmin/3d-forge/blob/master/forge/scripts/tilejson_writer.py
(that is if you store your tiles in s3)

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

No branches or pull requests

4 participants