Tired of Pre-Rendering Every Tile? TiTiler Serves Them on the Fly
You know the drill: you've got a massive GeoTIFF, and you need to serve it as map tiles. The traditional approach means pre-processing the entire file into thousands of static PNG files, storing them somewhere, and hoping your data doesn't change. It's slow, wasteful, and frankly, a pain to maintain. What if you could just point a server at the source file and let it generate only the tiles that are actually requested? That's the core idea behind TiTiler.
TiTiler (pronounced tee-tiler, a nod to the French word petit) is a set of Python modules for building dynamic tile servers. It's built on top of FastAPI and Rasterio/GDAL, and it's the direct descendant of the older cogeo-tiler and cogeo-mosaic-tiler projects.
What It Does
At its heart, TiTiler is a framework for creating FastAPI applications that generate map tiles on demand. Instead of pre-rendering a raster into a pyramid of static files, you stand up a service that reads directly from the source data—typically a Cloud Optimized GeoTIFF (COG)—and slices out just the tile a client requests at that moment.
The project was recently restructured. Since version 0.3.0, the monolithic TiTiler module has been split into a set of namespace packages under titiler.{package}. This modular approach lets you pick and choose the components you need:
titiler.core: The foundation, containing libraries to build a dynamic tiler for COGs and STAC assets.titiler.xarray: Adds support for multi-dimensional datasets like Zarr and NetCDF, leveraging Xarray under the hood.titiler.extensions: A set of optional add-ons (the README gets cut off here, but the pattern is clear—you can extend the core without bloating it).
Beyond the core tiling logic, TiTiler supports a wide range of output formats (JPEG, PNG, WEBP, GeoTIFF, and NumpyTile, to name a few) and multiple projection systems via the morecantile library. It also provides OGC-compliant RESTful endpoints for WMTS and the OGC Tiles API, plus partial support for the OGC Maps API. Because it's built on FastAPI, you get automatic OpenAPI documentation for free.
Why It's Cool
Dynamic tiling is a genuinely clever approach for a few reasons, and TiTiler implements it well. Here's what stands out:
-
No more pre-processing pipeline. This is the big one. You skip the expensive step of generating and storing thousands of static tiles. If your data updates, you don't need to re-run a batch job—the server reads the latest state of the file. It's a much simpler operational model.
-
The modular design is smart. The split into
titiler.coreandtitiler.xarraymeans you're not forced to install a bunch of dependencies you'll never use. If you're only working with standard GeoTIFFs, you don't need the Xarray/Zarr stack. If you are working with multi-dimensional climate or ocean data, that support is there when you need it. -
It's opinionated about modern standards. The project leans heavily into Cloud Optimized GeoTIFFs, which are designed for exactly this kind of HTTP range-request-based access. It also embraces the SpatioTemporal Asset Catalog (STAC) spec, so it slots nicely into modern geospatial data pipelines.
-
You get the FastAPI ecosystem. Automatic interactive docs, async support, dependency injection, and easy validation are all baked in. If you've built FastAPI apps before, extending TiTiler with custom endpoints or middleware feels natural.
-
Deployment options are included. The README mentions examples for AWS Lambda, ECS via CDK, and a Kubernetes Helm chart. That's a huge time-saver when you're trying to move from a local proof-of-concept to something that actually runs in production.
-
Virtual mosaics are supported. Using the MosaicJSON spec, you can stitch together multiple images and serve them as if they were a single seamless layer. That's powerful for large-area coverage that spans multiple source files.
How to Try It
The easiest way to get a feel for TiTiler is to check out the official documentation and the source code. The project maintains a live demo and a binder environment, which lets you spin up an interactive notebook without installing anything locally.
If you want to run it yourself, the project publishes Docker images on Docker Hub. A quick way to start is to pull the image and run it with Docker, or you can install the specific Python packages you need from PyPI:
# Install the core package
pip install titiler.core
# Or if you need multi-dimensional support
pip install titiler.xarray
Since TiTiler is a framework rather than a single standalone app, the best next step is to look at the examples in the repository. You'll find patterns for creating a minimal tiler application and wiring up the various endpoints. The repository also includes deployment examples for Lambda and ECS if you're ready to take it to the cloud.
Head over to the TiTiler GitHub repository to explore the code, or dive into the full documentation for detailed usage guides.
Final Thoughts
TiTiler isn't a magic bullet for every geospatial use case—if you have a massive, static dataset with predictable access patterns, pre-rendered tiles might still be more cost-effective. But for dynamic data, on-the-fly processing, or situations where you want to avoid a heavy preprocessing step, it's a genuinely practical tool. The modular architecture and clean FastAPI foundation make it a solid choice for developers who want to build custom, standards-compliant tile services without reinventing the wheel. It's worth a look if you're building anything that serves raster data over the web.
Follow @githubprojects for more developer tools and open source projects.