TiTiler's first goal is to create a lightweight but performant dynamic tile server... but what do we mean by this?
When you zoom/pan on a web map, you are visualizing either vector or raster data that is loaded by your web client (e.g Chrome). Vector Tiles are rendered
On the Fly, meaning the map library (e.g MapboxGL) will apply colors or width on the vector it receives to create a visual representation on the map. This is possible because we can encode and compress
vector data very efficently, which each tile being only couple of kilo octets.
On the other side, raster data is a really dense format, a
256 x 256 x 3 tile (True color image) needs to encode
196 608 values, and depending on the data type (Integer, Float, Complex), a raster tile can be really heavy. Note, if the original data is stored in
Float, to be able to obtain a visual representation we need to
rescale the initial data to a
Byte range of 0 to 255 values.
Static tiling steps¶
Before, to be able to visualize raster data on a web map, we needed to:
- rescale the data to integer (0 -> 255)
- reproject the data to Web Mercator (or the projection of the web map application)
- split the data in tiles (256x256 or 512x512) and create different zoom levels (ref: gdal.org/programs/gdal2tiles.html)
- create a tile server that reads the tiles from a directory/cloud storage
Dynamic tiling steps¶
The goal of the
Dynamic Tiling process is to get rid of all the pre-processing steps, by creating a tile server which can access the raw data (COG) and apply operations (rescaling, reprojection, image encoding) to create the visual tiles on the fly.
- Open the file and get internal metadata (stored in the header of the file)
- Read internal parts needed to construct the output tile
- Apply data rescaling (if needed)
- Apply colormap (if needed)
- Encode the data into a visual image format (JPEG, PNG, WEBP)
Static tile generation you are often limited because you are visualizing data that is fixed and stored somewhere on a disk. With
Dynamic tiling, the user has the possibility to apply their own choice of processing (e.g rescaling, masking) before creating the
Dynamic Tiling features¶
- Access the raw data
- Multiple projection support
- Rescaling (when working with non-byte data)
- Selection of bands/bands combination/bands math