quantized-mesh-tile Documentation
Release 0.4
Loïc Gasser
Apr 21, 2017
ii
CHAPTER 1
Reference Documentation
Tutorial
Introduction
This tutorial shows how to use the quantized mesh tile module. This format is designed to work exclusively with the
TMS (Tile Map Service) tiling scheme and is optimized to display TIN (Triangulated irregular network) data on the
web.
The only available client able to read and display this format is Cesium.
This module has been developed based on the specifications of the format described here.
Therefore, if you’ve planned on creating your own terrain server, please make sure you follow all the instructions
provided in the specifications of the format. You may also need to define a layer.json metadata file at the root of your
terrain server which seems to be a derivative of Mapbox tilejson-spec. Make sure you get it right. ;)
Create a terrain tile
The encoding module can determine the extent of a tile based on the geometries it receives as arguments. Nevertheless,
this can only work if the tile has at least 1 triangle on all of its 4 edges. As a result, it is advised to always provide the
bounds of the tile.
So first determine the extent of the tile.
>>> from quantized_mesh_tile.global_geodetic import GlobalGeodetic
>>> geodetic = GlobalGeodetic(True)
>>> [z, x, y] = [9, 533, 383]
>>> [west, south, east, north] = bounds = geodetic.TileBounds(x, y, z)
Now that we have the extent, let’s assume you generated a mesh using your favorite meshing engine and ended up
with the following geometries.
1
评论1