titiler.extensions
Extent TiTiler Tiler Factories
Installation
python -m pip install -U pip
# From Pypi
python -m pip install titiler.extensions
# Or from sources
git clone https://github.com/developmentseed/titiler.git
cd titiler && python -m pip install -e src/titiler/core -e src/titiler/extensions
Available extensions
cogValidateExtension
- Goal: adds a
/validateendpoint which return the content of rio-cogeoinfomethod - Additional requirements:
titiler.extensions["cogeo"]
cogViewerExtension
- Goal: adds a
/viewerendpoint which return an HTML viewer for simple COGs
stacViewerExtension
- Goal: adds a
/viewerendpoint which return an HTML viewer for STAC item
wmsExtension
- Goal: adds a
/wmsendpoint to support OGC Web Map Service (GetTileandGetCapabilities) specification
Use extensions
Extensions must be set at TilerFactory's creation using the extensions= options.
from fastapi import FastAPI
from titiler.core.factory import TilerFactory
from titiler.extensions import cogValidateExtension
# Create a FastAPI application
app = FastAPI(description="A lightweight Cloud Optimized GeoTIFF tile server")
# Create a set of endpoints using TiTiler TilerFactory
tiler = TilerFactory(
router_prefix="/cog",
extensions=[
cogValidateExtension() # the cogeoExtension will add a rio-cogeo /validate endpoint
],
)
# Register endpoints to the application
app.include_router(tiler.router, prefix="/cog")
Create your own
from dataclasses import dataclass, field
from typing import Tuple, List, Optional
import rasterio
from starlette.responses import Response
from fastapi import Depends, FastAPI, Query
from titiler.core.factory import TilerFactory, FactoryExtension
from titiler.core.dependencies import ImageRenderingParams
from titiler.core.factory import TilerFactory
from titiler.core.resources.enums import ImageType
@dataclass
class thumbnailExtension(FactoryExtension):
"""Add endpoint to a TilerFactory."""
# Set some options
max_size: int = field(default=128)
# Register method is mandatory and must take a TilerFactory object as input
def register(self, factory: TilerFactory):
"""Register endpoint to the tiler factory."""
# register an endpoint to the factory's router
@factory.router.get(
"/thumbnail",
responses={
200: {
"content": {
"image/png": {},
"image/jpeg": {},
},
"description": "Return an image.",
}
},
response_class=Response,
)
def thumbnail(
# we can reuse the factory dependency
src_path: str = Depends(factory.path_dependency),
reader_params=Depends(factory.reader_dependency),
layer_params=Depends(factory.layer_dependency),
dataset_params=Depends(factory.dataset_dependency),
post_process=Depends(factory.process_dependency),
colormap=Depends(factory.colormap_dependency),
render_params=Depends(factory.render_dependency),
env=Depends(factory.environment_dependency),
):
with rasterio.Env(**env):
with factory.reader(src_path, **reader_params.as_dict()) as src:
image = src.preview(
max_size=self.max_size,
**layer_params.as_dict(),
**dataset_params.as_dict(),
)
if post_process:
image = post_process(image)
format = ImageType.jpeg if image.mask.all() else ImageType.png
if post_process:
image = post_process(image)
content, media_type = factory.render_func(
image,
colormap=colormap,
**render_params.as_dict(),
)
return Response(content, media_type=media_type)
# Use it
app = FastAPI()
tiler = TilerFactory(extensions=[thumbnailExtension(max_size=64)])
app.include_router(tiler.router)
Release files for titiler-extensions 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| titiler_extensions-2.3.0.tar.gz | 32.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| titiler_extensions-2.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.3 kB
Release files / titiler_extensions-2.3.0.tar.gz
| Download URL | titiler_extensions-2.3.0.tar.gz |
|---|---|
| Size | 32.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
098959a366eb0f26d6f52a7d3889ade5b1445ccf8e899b5c73ea842978370cbb
|
|
BLAKE2b-256 checksum How to use checksums |
d6e3c577d14fce0d04cbc3377f83fe38db89d0b85d85f2273b09d3ac8f7b06dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.
Transparency logRelease files / titiler_extensions-2.3.0-py3-none-any.whl
| Download URL | titiler_extensions-2.3.0-py3-none-any.whl |
|---|---|
| Size | 39.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b31d5f2b173e7a42ae5d800552c46a3490580c0c2061ca041bc31108e21f0e02
|
|
BLAKE2b-256 checksum How to use checksums |
b0505f80d78c0da1b928c547c179a2cdbc9f8177ee8d10b2cf6f006a37b69f9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.
Transparency log