diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/404.html b/404.html new file mode 100644 index 000000000..01c8428f5 --- /dev/null +++ b/404.html @@ -0,0 +1,2143 @@ + + + +
+ + + + + + + + + + + + + + + + +Important
+This has been deprecated. You can now pass environment_dependency=lambda: {"GDAL_DISABLE_READDIR_ON_OPEN":"FALSE"}
to the Tiler Factory. This will be passed to a rasterio.Env()
context manager on top of all gdal related blocks.
from titiler.core.factory import TilerFactory
+cog = TilerFactory(
+ reader=COGReader,
+ router_prefix="cog",
+ environment_dependency=lambda: {"GDAL_DISABLE_READDIR_ON_OPEN":"FALSE"},
+)
+
Sometimes, specifically when using GDAL, it can be useful to have environment variables set for certain endpoints
+(e.g. when using Landsat data on AWS you need GDAL_DISABLE_READDIR_ON_OPEN=FALSE
but you don't want this environment variable set for other endpoints). To be able to do this
+we created a custom APIRoute class which wraps classic fastapi APIRoute with a rasterio.Env()
block: github.com/developmentseed/titiler/blob/8a7127ca56631c2c327713d99e80285048c3aa6c/titiler/custom/routing.py#L13-L41
Example: +
from fastapi import FastAPI, APIRouter
+from rasterio._env import get_gdal_config
+from titiler.core.routing import apiroute_factory
+from titiler.core.factory import TilerFactory
+
+app = FastAPI()
+route_class = apiroute_factory({"GDAL_DISABLE_READDIR_ON_OPEN": "FALSE"})
+router = APIRouter(route_class=route_class)
+
+tiler = TilerFactory(router=router)
+
+@router.get("/simple")
+def simple():
+ """should return FALSE."""
+ res = get_gdal_config("GDAL_DISABLE_READDIR_ON_OPEN")
+ return {"env": res}
+
+app.include_router(router)
+
Important
+This has only be tested for python 3.6 and 3.7.
+Starting with titiler>=0.8
, we added the possibility to apply custom algorithms on Image outputs from tile
, crop
or preview
endpoints.
The algorithms are meant to overcome the limitation of expression
(using numexpr) by allowing more complex operations.
We added a set of custom algorithms:
+hillshade
: Create hillshade from elevation datasetcontours
: Create contours lines (raster) from elevation datasetterrarium
: Mapzen's format to encode elevation value in RGB values (github.com/tilezen/joerd/blob/master/docs/formats.md#terrarium)terrainrgb
: Mapbox's format to encode elevation value in RGB values (docs.mapbox.com/data/tilesets/guides/access-elevation-data/)normalizedIndex
: Normalized Difference Index (e.g NDVI)# return a
+httpx.get(
+ "http://127.0.0.1:8081/cog/tiles/16/34059/23335",
+ params={
+ "url": "https://data.geo.admin.ch/ch.swisstopo.swissalti3d/swissalti3d_2019_2573-1085/swissalti3d_2019_2573-1085_0.5_2056_5728.tif",
+ "buffer": 3, # By default hillshade will crop the output with a 3pixel buffer, so we need to apply a buffer on the tile
+ "algorithm": "hillshade",
+ },
+)
+
# Pass algorithm parameter as a json string
+httpx.get(
+ "http://127.0.0.1:8081/cog/preview",
+ params={
+ "url": "https://data.geo.admin.ch/ch.swisstopo.swissalti3d/swissalti3d_2019_2573-1085/swissalti3d_2019_2573-1085_0.5_2056_5728.tif",
+ "algorithm": "contour",
+ "algorithm_params": json.dumps({"minz": 1600, "maxz": 2100}) # algorithm params HAVE TO be provided as a JSON string
+ },
+)
+
A titiler'w Algorithm
must be defined using titiler.core.algorithm.BaseAlgorithm
base class.
class BaseAlgorithm(BaseModel, metaclass=abc.ABCMeta):
+ """Algorithm baseclass.
+
+ Note: attribute starting with `input_` or `output_` are considered as metadata
+
+ """
+
+ # metadata
+ input_nbands: int
+ output_nbands: int
+ output_dtype: str
+ output_min: Optional[Sequence]
+ output_max: Optional[Sequence]
+
+ @abc.abstractmethod
+ def __call__(self, img: ImageData) -> ImageData:
+ """Apply algorithm"""
+ ...
+
+ class Config:
+ """Config for model."""
+
+ extra = "allow"
+
This base class defines that algorithm:
+HAVE TO implement an __call__
method which takes an ImageData as input and return an ImageData. Using __call__
let us use the object as a callable (e.g Algorithm(**kwargs)(image)
).
can have input/output metadata (informative)
+can haveparameters
(enabled by extra = "allow"
pydantic config)
Here is a simple example of a custom Algorithm:
+from titiler.core.algorithm import BaseAlgorithm
+from rio_tiler.models import ImageData
+
+class Multiply(BaseAlgorithm):
+
+ # Parameters
+ factor: int # There is no default, which means calls to this algorithm without any parameter will fail
+
+ # We don't set any metadata for this Algorithm
+
+ def __call__(self, img: ImageData) -> ImageData:
+ # Multiply image data bcy factor
+ data = img.data * self.factor
+
+ # Create output ImageData
+ return ImageData(
+ data,
+ img.mask,
+ assets=img.assets,
+ crs=img.crs,
+ bounds=img.bounds,
+ )
+
Using a Pydantic's BaseModel
class to construct the custom algorithm enables two things parametrization and type casting/validation.
If we look at the Multiply
algorithm, we can see it needs a factor
parameter. In Titiler (in the post_process dependency) we will pass this parameter via query string (e.g /preview.png?algo=multiply&algo_parameter={"factor":3}
) and pydantic will make sure we use the right types/values.
# Available algorithm
+algo = {"multiply": Multiply}
+
+def post_process_dependency(
+ algorithm: Literal[tuple(algo.keys())] = Query(None, description="Algorithm name"),
+ algorithm_params: str = Query(None, description="Algorithm parameter"),
+) -> Optional[BaseAlgorithm]:
+ """Data Post-Processing dependency."""
+ # Parse `algorithm_params` JSON parameters
+ kwargs = json.loads(algorithm_params) if algorithm_params else {}
+ if algorithm:
+ # Here we construct the Algorithm Object with the kwargs from the `algo_params` query-parameter
+ return algo[algorithm](**kwargs)
+
+ return None
+
To be able to use your own algorithm in titiler's endpoint you need to create a Dependency
to tell the application what algorithm are available.
To ease the dependency creation, we added a dependency
property in the titiler.core.algorithm.Algorithms
class, which will return a FastAPI dependency to be added to the endpoints.
Note: The Algorithms
class is a store for the algorithm that can be extented using the .register()
method.
from typing import Callable
+from titiler.core.algorithm import algorithms as default_algorithms
+from titiler.core.algorithm import Algorithms
+from titiler.core.factory import TilerFactory
+
+# Add the `Multiply` algorithm to the default ones
+algorithms: Algorithms = default_algorithms.register({"multiply": Multiply})
+
+# Create a PostProcessParams dependency
+PostProcessParams: Callable = algorithms.dependency
+
+endpoints = TilerFactory(process_dependency=PostProcessParams)
+
When creating a map tile (or other images), we will fist apply the algorithm
then the rescaling
and finally the color_formula
.
with reader(url as src_dst:
+ image = src_dst.tile(
+ x,
+ y,
+ z,
+ )
+ dst_colormap = getattr(src_dst, "colormap", None)
+
+# Apply algorithm
+if post_process:
+ image = post_process(image)
+
+# Apply data rescaling
+if rescale:
+ image.rescale(rescale)
+
+# Apply color-formula
+if color_formula:
+ image.apply_color_formula(color_formula)
+
+# Determine the format
+if not format:
+ format = ImageType.jpeg if image.mask.all() else ImageType.png
+
+# Image Rendering
+return image.render(
+ img_format=format.driver,
+ colormap=colormap or dst_colormap,
+ **format.profile,
+)
+
Starting with titiler>=0.11
, we added a new titiler package titiler.extensions
which aim to ease the addition of optional
endpoints to factories.
In titiler.core.factory.BaseTilerFactory
class, we've added a new attribute: extensions: List[FactoryExtension] = field(default_factory=list)
. The list
of extension will then be used in the post-init
step such as:
def __post_init__(self):
+ """Post Init: register route and configure specific options."""
+ # Register endpoints
+ self.register_routes()
+
+ # Register Extensions
+ for ext in self.extensions:
+ ext.register(self)
+
+ # Update endpoints dependencies
+ for scopes, dependencies in self.route_dependencies:
+ self.add_route_dependencies(scopes=scopes, dependencies=dependencies)
+
We defined extension using an Abstract Base Class to make sure they implement a register
method:
@dataclass
+class FactoryExtension(metaclass=abc.ABCMeta):
+ """Factory Extension."""
+
+ @abc.abstractmethod
+ def register(self, factory: "BaseTilerFactory"):
+ """Register extension to the factory."""
+ ...
+
/validate
endpoint which return the content of rio-cogeo info
methodtitiler.extensions["cogeo"]
(installs rio-cogeo
)/viewer
endpoint which return an HTML viewer for simple COGs/viewer
endpoint which return an HTML viewer for STAC item/stac
endpoint which return an HTML viewer for STAC itemtitiler.extensions["stac"]
(installs rio-stac
)/wms
endpoint to support OGC WMS specification (GetCapabilities
and GetMap
)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")
+
See titiler.application for a full example.
+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 BaseTilerFactory, FactoryExtension, TilerFactory
+from titiler.core.dependencies import RescalingParams
+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 BaseTilerFactory object as input
+ def register(self, factory: BaseTilerFactory):
+ """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),
+ layer_params=Depends(factory.layer_dependency),
+ dataset_params=Depends(factory.dataset_dependency),
+ post_process=Depends(factory.process_dependency),
+ rescale: Optional[List[Tuple[float, ...]]] = Depends(RescalingParams),
+ color_formula: Optional[str] = Query(
+ None,
+ title="Color Formula",
+ description="rio-color formula (info: https://github.com/mapbox/rio-color)",
+ ),
+ colormap=Depends(factory.colormap_dependency),
+ render_params=Depends(factory.render_dependency),
+ reader_params=Depends(factory.reader_dependency),
+ env=Depends(factory.environment_dependency),
+ ):
+ with rasterio.Env(**env):
+ with factory.reader(src_path, **reader_params) as src:
+ image = src.preview(
+ max_size=self.max_size,
+ **layer_params,
+ **dataset_params,
+ )
+
+ if post_process:
+ image = post_process(image)
+
+ if rescale:
+ image.rescale(rescale)
+
+ if color_formula:
+ image.apply_color_formula(color_formula)
+
+ format = ImageType.jpeg if image.mask.all() else ImageType.png
+
+ content = image.render(
+ img_format=format.driver,
+ colormap=colormap,
+ **format.profile,
+ **render_params,
+ )
+
+ return Response(content, media_type=format.mediatype)
+
+# Use it
+app = FastAPI()
+tiler = TilerFactory(
+ extensions=[
+ thumbnailExtension(max_size=64)
+ ]
+)
+app.include_router(tiler.router)
+
TiTiler
is designed to help user customize input/output for each endpoint. This section goes over some simple customization examples.
Add user defined colormap to the default colormaps provided by rio-tiler
+from fastapi import FastAPI
+
+from rio_tiler.colormap import cmap as default_cmap
+
+from titiler.core.dependencies import create_colormap_dependency
+from titiler.core.factory import TilerFactory
+
+
+app = FastAPI(title="My simple app with custom TMS")
+
+cmap_values = {
+ "cmap1": {6: (4, 5, 6, 255)},
+}
+# add custom colormap `cmap1` to the default colormaps
+cmap = default_cmap.register(cmap_values)
+ColorMapParams = create_colormap_dependency(cmap)
+
+
+cog = TilerFactory(colormap_dependency=ColorMapParams)
+app.include_router(cog.router)
+
reader_dependency
¶One common customization could be to create your own path_dependency
. This dependency is used on all endpoint and pass inputs to the Readers (MosaicBackend, COGReader, STACReader...).
Here an example which allow a mosaic to be passed by a mosaic name
instead of a full S3 url.
import os
+import re
+
+from fastapi import FastAPI, HTTPException, Query
+
+from titiler.core.dependencies import DefaultDependency
+from titiler.mosaic.factory import MosaicTilerFactory
+
+
+MOSAIC_BACKEND = os.getenv("TITILER_MOSAIC_BACKEND")
+MOSAIC_HOST = os.getenv("TITILER_MOSAIC_HOST")
+
+
+def MosaicPathParams(
+ mosaic: str = Query(..., description="mosaic name")
+) -> str:
+ """Create dataset path from args"""
+ # mosaic name should be in form of `{user}.{layername}`
+ if not re.match(self.mosaic, r"^[a-zA-Z0-9-_]{1,32}\.[a-zA-Z0-9-_]{1,32}$"):
+ raise HTTPException(
+ status_code=400,
+ detail=f"Invalid mosaic name {self.input}.",
+ )
+
+ return f"{MOSAIC_BACKEND}{MOSAIC_HOST}/{self.input}.json.gz"
+
+
+app = FastAPI()
+mosaic = MosaicTilerFactory(path_dependency=MosaicPathParams)
+app.include_router(mosaic.router)
+
The endpoint url will now look like: {endpoint}/mosaic/tilejson.json?mosaic=vincent.mosaic
from morecantile import tms, TileMatrixSet
+from pyproj import CRS
+
+from titiler.core.factory import TilerFactory
+
+# 1. Create Custom TMS
+EPSG6933 = TileMatrixSet.custom(
+ (-17357881.81713629, -7324184.56362408, 17357881.81713629, 7324184.56362408),
+ CRS.from_epsg(6933),
+ identifier="EPSG6933",
+ matrix_scale=[1, 1],
+)
+
+# 2. Register TMS
+tms = tms.register([EPSG6933])
+
+# 3. Create Tiler
+COGTilerWithCustomTMS = TilerFactory(supported_tms=tms)
+
from dataclasses import dataclass
+from typing import List, Optional
+
+from titiler.mosaic.factory import MosaicTilerFactory
+from titiler.core.errors import BadRequestError
+from cogeo_mosaic.mosaic import MosaicJSON
+from cogeo_mosaic.utils import get_footprints
+import rasterio
+
+from pydantic import BaseModel
+
+
+# Models from POST/PUT Body
+class CreateMosaicJSON(BaseModel):
+ """Request body for MosaicJSON creation"""
+
+ files: List[str] # Files to add to the mosaic
+ url: str # path where to save the mosaicJSON
+ minzoom: Optional[int] = None
+ maxzoom: Optional[int] = None
+ max_threads: int = 20
+ overwrite: bool = False
+
+
+class UpdateMosaicJSON(BaseModel):
+ """Request body for updating an existing MosaicJSON"""
+
+ files: List[str] # Files to add to the mosaic
+ url: str # path where to save the mosaicJSON
+ max_threads: int = 20
+ add_first: bool = True
+
+
+@dataclass
+class CustomMosaicFactory(MosaicTilerFactory):
+
+ def register_routes(self):
+ """Update the class method to add create/update"""
+ super().register_routes()
+ # new methods/endpoint
+ self.create()
+ self.update()
+
+ def create(self):
+ """Register / (POST) Create endpoint."""
+
+ @self.router.post(
+ "", response_model=MosaicJSON, response_model_exclude_none=True
+ )
+ def create(
+ body: CreateMosaicJSON,
+ env=Depends(self.environment_dependency),
+ ):
+ """Create a MosaicJSON"""
+ # Write can write to either a local path, a S3 path...
+ # See https://developmentseed.org/cogeo-mosaic/advanced/backends/ for the list of supported backends
+
+ # Create a MosaicJSON file from a list of URL
+ mosaic = MosaicJSON.from_urls(
+ body.files,
+ minzoom=body.minzoom,
+ maxzoom=body.maxzoom,
+ max_threads=body.max_threads,
+ )
+
+ # Write the MosaicJSON using a cogeo-mosaic backend
+ with rasterio.Env(**env):
+ with self.reader(
+ body.url, mosaic_def=mosaic, reader=self.dataset_reader
+ ) as mosaic:
+ try:
+ mosaic.write(overwrite=body.overwrite)
+ except NotImplementedError:
+ raise BadRequestError(
+ f"{mosaic.__class__.__name__} does not support write operations"
+ )
+ return mosaic.mosaic_def
+
+ def update(self):
+ """Register / (PUST) Update endpoint."""
+
+ @self.router.put(
+ "", response_model=MosaicJSON, response_model_exclude_none=True
+ )
+ def update_mosaicjson(
+ body: UpdateMosaicJSON,
+ env=Depends(self.environment_dependency),
+ ):
+ """Update an existing MosaicJSON"""
+ with rasterio.Env(**env):
+ with self.reader(body.url, reader=self.dataset_reader) as mosaic:
+ features = get_footprints(body.files, max_threads=body.max_threads)
+ try:
+ mosaic.update(features, add_first=body.add_first, quiet=True)
+ except NotImplementedError:
+ raise BadRequestError(
+ f"{mosaic.__class__.__name__} does not support update operations"
+ )
+ return mosaic.mosaic_def
+
If you are new to the concept of Dependency Injection, please read this awesome tutorial: fastapi.tiangolo.com/tutorial/dependencies/
+In titiler Factories
, we use the dependencies to define the inputs for each endpoint (and thus the OpenAPI documentation).
Example: +
from dataclasses import dataclass
+from fastapi import Depends, FastAPI, Query
+from titiler.core.dependencies import DefaultDependency
+from typing_extensions import Annotated
+from rio_tiler.io import Reader
+
+@dataclass
+class ImageParams(DefaultDependency):
+ max_size: Annotated[
+ int, Query(description="Maximum image size to read onto.")
+ ] = 1024
+
+app = FastAPI()
+
+# Simple preview endpoint
+@app.get("/preview.png")
+def preview(
+ url: str = Query(..., description="data set URL"),
+ params: ImageParams = Depends(),
+):
+ with Reader(url) as cog:
+ img = cog.preview(**params) # classes built with `DefaultDependency` can be unpacked
+ # or
+ img = cog.preview(max_size=params.max_size)
+ ...
+
Important
+In the example above, we create a custom ImageParams
dependency which will then be injected to the preview
endpoint to add max_size, height and width query string parameters.
Using titiler.core.dependencies.DefaultDependency
, we can unpack
the class as if it was a dictionary, which helps with customization.
Define assets
.
Name | +Type | +Required | +Default | +
---|---|---|---|
assets | +Query (str) | +No | +None | +
@dataclass
+class AssetsParams(DefaultDependency):
+ """Assets parameters."""
+
+ assets: List[str] = Query(
+ None,
+ title="Asset names",
+ description="Asset's names.",
+ openapi_examples={
+ "one-asset": {
+ "description": "Return results for asset `data`.",
+ "value": ["data"],
+ },
+ "multi-assets": {
+ "description": "Return results for assets `data` and `cog`.",
+ "value": ["data", "cog"],
+ },
+ },
+ )
+
Define assets
with option of per-asset
expression with asset_expression
option.
Name | +Type | +Required | +Default | +
---|---|---|---|
assets | +Query (str) | +No | +None | +
asset_indexes | +Query (str) | +No | +None | +
asset_expression | +Query (str) | +No | +False | +
@dataclass
+class AssetsBidxParams(AssetsParams):
+ """Assets, Asset's band Indexes and Asset's band Expression parameters."""
+
+ asset_indexes: Annotated[
+ Optional[Sequence[str]],
+ Query(
+ title="Per asset band indexes",
+ description="Per asset band indexes",
+ alias="asset_bidx",
+ openapi_examples={
+ "one-asset": {
+ "description": "Return indexes 1,2,3 of asset `data`.",
+ "value": ["data|1;2;3"],
+ },
+ "multi-assets": {
+ "description": "Return indexes 1,2,3 of asset `data` and indexes 1 of asset `cog`",
+ "value": ["data|1;2;3", "cog|1"],
+ },
+ },
+ ),
+ ] = None
+
+ asset_expression: Annotated[
+ Optional[Sequence[str]],
+ Query(
+ title="Per asset band expression",
+ description="Per asset band expression",
+ openapi_examples={
+ "one-asset": {
+ "description": "Return results for expression `b1*b2+b3` of asset `data`.",
+ "value": ["data|b1*b2+b3"],
+ },
+ "multi-assets": {
+ "description": "Return results for expressions `b1*b2+b3` for asset `data` and `b1+b3` for asset `cog`.",
+ "value": ["data|b1*b2+b3", "cog|b1+b3"],
+ },
+ },
+ ),
+ ] = None
+
+ def __post_init__(self):
+ """Post Init."""
+ if self.asset_indexes:
+ self.asset_indexes: Dict[str, Sequence[int]] = { # type: ignore
+ idx.split("|")[0]: list(map(int, idx.split("|")[1].split(",")))
+ for idx in self.asset_indexes
+ }
+
+ if self.asset_expression:
+ self.asset_expression: Dict[str, str] = { # type: ignore
+ idx.split("|")[0]: idx.split("|")[1] for idx in self.asset_expression
+ }
+
Define assets
.
Name | +Type | +Required | +Default | +
---|---|---|---|
assets | +Query (str) | +No* | +None | +
expression | +Query (str) | +No* | +None | +
asset_indexes | +Query (str) | +No | +None | +
asset_as_band | +Query (bool) | +No | +False | +
* assets
or expression
is required.
@dataclass
+class AssetsBidxExprParams(AssetsParams):
+ """Assets, Expression and Asset's band Indexes parameters."""
+
+ expression: Annotated[
+ Optional[str],
+ Query(
+ title="Band Math expression",
+ description="Band math expression between assets",
+ openapi_examples={
+ "simple": {
+ "description": "Return results of expression between assets.",
+ "value": "asset1_b1 + asset2_b1 / asset3_b1",
+ },
+ },
+ ),
+ ] = None
+
+ asset_indexes: Annotated[
+ Optional[Sequence[str]],
+ Query(
+ title="Per asset band indexes",
+ description="Per asset band indexes (coma separated indexes)",
+ alias="asset_bidx",
+ openapi_examples={
+ "one-asset": {
+ "description": "Return indexes 1,2,3 of asset `data`.",
+ "value": ["data|1,2,3"],
+ },
+ "multi-assets": {
+ "description": "Return indexes 1,2,3 of asset `data` and indexes 1 of asset `cog`",
+ "value": ["data|1,2,3", "cog|1"],
+ },
+ },
+ ),
+ ] = None
+
+ asset_as_band: Annotated[
+ Optional[bool],
+ Query(
+ title="Consider asset as a 1 band dataset",
+ description="Asset as Band",
+ ),
+ ] = None
+
+ def __post_init__(self):
+ """Post Init."""
+ if not self.assets and not self.expression:
+ raise MissingAssets(
+ "assets must be defined either via expression or assets options."
+ )
+
+ if self.asset_indexes:
+ self.asset_indexes: Dict[str, Sequence[int]] = { # type: ignore
+ idx.split("|")[0]: list(map(int, idx.split("|")[1].split(",")))
+ for idx in self.asset_indexes
+ }
+
Define assets
. Without requirement on assets nor expression.
Name | +Type | +Required | +Default | +
---|---|---|---|
assets | +Query (str) | +No | +None | +
expression | +Query (str) | +No | +None | +
asset_indexes | +Query (str) | +No | +None | +
asset_as_band | +Query (bool) | +No | +False | +
@dataclass
+class AssetsBidxExprParamsOptional(AssetsBidxExprParams):
+ """Assets, Expression and Asset's band Indexes parameters but with no requirement."""
+
+ def __post_init__(self):
+ """Post Init."""
+ if self.asset_indexes:
+ self.asset_indexes: Dict[str, Sequence[int]] = { # type: ignore
+ idx.split("|")[0]: list(map(int, idx.split("|")[1].split(",")))
+ for idx in self.asset_indexes
+ }
+
Define bands
.
Name | +Type | +Required | +Default | +
---|---|---|---|
bands | +Query (str) | +No | +None | +
@dataclass
+class BandsParams(DefaultDependency):
+ """Band names parameters."""
+
+ bands: List[str] = Query(
+ None,
+ title="Band names",
+ description="Band's names.",
+ openapi_examples={
+ "one-band": {
+ "description": "Return results for band `B01`.",
+ "value": ["B01"],
+ },
+ "multi-bands": {
+ "description": "Return results for bands `B01` and `B02`.",
+ "value": ["B01", "B02"],
+ },
+ },
+ )
+
Define bands
.
Name | +Type | +Required | +Default | +
---|---|---|---|
bands | +Query (str) | +No* | +None | +
expression | +Query (str) | +No* | +None | +
* bands
or expression
is required.
@dataclass
+class BandsExprParamsOptional(ExpressionParams, BandsParams):
+ """Optional Band names and Expression parameters."""
+
+ pass
+
Define bands
.
Name | +Type | +Required | +Default | +
---|---|---|---|
bands | +Query (str) | +No | +None | +
expression | +Query (str) | +No | +None | +
@dataclass
+class BandsExprParamsOptional(ExpressionParams, BandsParams):
+ """Optional Band names and Expression parameters."""
+
+ pass
+
BidxParams
¶Define band indexes.
+Name | +Type | +Required | +Default | +
---|---|---|---|
bidx | +Query (int) | +No | +None | +
@dataclass
+class BidxParams(DefaultDependency):
+ """Band Indexes parameters."""
+
+ indexes: Annotated[
+ Optional[List[int]],
+ Query(
+ title="Band indexes",
+ alias="bidx",
+ description="Dataset band indexes",
+ openapi_examples={"one-band": {"value": [1]}, "multi-bands": {"value": [1, 2, 3]}},
+ ),
+ ] = None
+
ExpressionParams
¶Define band expression.
+Name | +Type | +Required | +Default | +
---|---|---|---|
expression | +Query (str) | +No | +None | +
@dataclass
+class ExpressionParams(DefaultDependency):
+ """Expression parameters."""
+
+ expression: Annotated[
+ Optional[str],
+ Query(
+ title="Band Math expression",
+ description="rio-tiler's band math expression",
+ openapi_examples={
+ "simple": {"description": "Simple band math.", "value": "b1/b2"},
+ "multi-bands": {
+ "description": "Semicolon (;) delimited expressions (band1: b1/b2, band2: b2+b3).",
+ "value": "b1/b2;b2+b3",
+ },
+ },
+ ),
+ ] = None
+
BidxExprParams
¶Define band indexes or expression.
+Name | +Type | +Required | +Default | +
---|---|---|---|
bidx | +Query (int) | +No | +None | +
expression | +Query (str) | +No | +None | +
@dataclass
+class BidxExprParams(ExpressionParams, BidxParams):
+ """Band Indexes and Expression parameters."""
+
+ pass
+
ColorFormulaParams
¶Color Formula option (see vincentsarago/color-operations).
+Name | +Type | +Required | +Default | +
---|---|---|---|
color_formula | +Query (str) | +No | +None | +
def ColorFormulaParams(
+ color_formula: Annotated[
+ Optional[str],
+ Query(
+ title="Color Formula",
+ description="rio-color formula (info: https://github.com/mapbox/rio-color)",
+ ),
+ ] = None,
+) -> Optional[str]:
+ """ColorFormula Parameter."""
+ return color_formula
+
ColorMapParams
¶Colormap options. See titiler.core.dependencies.
+Name | +Type | +Required | +Default | +
---|---|---|---|
colormap_name | +Query (str) | +No | +None | +
colormap | +Query (encoded json) | +No | +None | +
cmap = {}
+
+def ColorMapParams(
+ colormap_name: Annotated[ # type: ignore
+ Literal[tuple(cmap.list())],
+ Query(description="Colormap name"),
+ ] = None,
+ colormap: Annotated[
+ Optional[str], Query(description="JSON encoded custom Colormap")
+ ] = None,
+):
+ if colormap_name:
+ return cmap.get(colormap_name)
+
+ if colormap:
+ try:
+ c = json.loads(
+ colormap,
+ object_hook=lambda x: {
+ int(k): parse_color(v) for k, v in x.items()
+ },
+ )
+
+ # Make sure to match colormap type
+ if isinstance(c, Sequence):
+ c = [(tuple(inter), parse_color(v)) for (inter, v) in c]
+
+ return c
+ except json.JSONDecodeError as e:
+ raise HTTPException(
+ status_code=400, detail="Could not parse the colormap value."
+ ) from e
+
+ return None
+
Define input Coordinate Reference System.
+Name | +Type | +Required | +Default | +
---|---|---|---|
crs | +Query (str) | +No | +None | +
def CoordCRSParams(
+ crs: Annotated[
+ Optional[str],
+ Query(
+ alias="coord_crs",
+ description="Coordinate Reference System of the input coords. Default to `epsg:4326`.",
+ ),
+ ] = None,
+) -> Optional[CRS]:
+ """Coordinate Reference System Coordinates Param."""
+ if crs:
+ return CRS.from_user_input(crs)
+
+ return None
+
DatasetParams
¶Overwrite nodata
value, apply rescaling
and change the I/O
or Warp
resamplings.
Name | +Type | +Required | +Default | +
---|---|---|---|
nodata | +Query (str, int, float) | +No | +None | +
unscale | +Query (bool) | +No | +False | +
resampling | +Query (str) | +No | +'nearest' | +
reproject | +Query (str) | +No | +'nearest' | +
@dataclass
+class DatasetParams(DefaultDependency):
+ """Low level WarpedVRT Optional parameters."""
+
+ nodata: Annotated[
+ Optional[Union[str, int, float]],
+ Query(
+ title="Nodata value",
+ description="Overwrite internal Nodata value",
+ ),
+ ] = None
+ unscale: Annotated[
+ bool,
+ Query(
+ title="Apply internal Scale/Offset",
+ description="Apply internal Scale/Offset. Defaults to `False`.",
+ ),
+ ] = False
+ resampling_method: Annotated[
+ RIOResampling,
+ Query(
+ alias="resampling",
+ description="RasterIO resampling algorithm. Defaults to `nearest`.",
+ ),
+ ] = "nearest"
+ reproject_method: Annotated[
+ WarpResampling,
+ Query(
+ alias="reproject",
+ description="WarpKernel resampling algorithm (only used when doing re-projection). Defaults to `nearest`.",
+ ),
+ ] = "nearest"
+
+ def __post_init__(self):
+ """Post Init."""
+ if self.nodata is not None:
+ self.nodata = numpy.nan if self.nodata == "nan" else float(self.nodata)
+ self.unscale = bool(self.unscale)
+
DatasetPathParams
¶Set dataset path.
+Name | +Type | +Required | +Default | +
---|---|---|---|
url | +Query (str) | +Yes | +- | +
def DatasetPathParams(
+ url: Annotated[str, Query(description="Dataset URL")]
+) -> str:
+ """Create dataset path from args"""
+ return url
+
Define output Coordinate Reference System.
+Name | +Type | +Required | +Default | +
---|---|---|---|
crs | +Query (str) | +No | +None | +
def DstCRSParams(
+ crs: Annotated[
+ Optional[str],
+ Query(
+ alias="dst_crs",
+ description="Output Coordinate Reference System.",
+ ),
+ ] = None,
+) -> Optional[CRS]:
+ """Coordinate Reference System Coordinates Param."""
+ if crs:
+ return CRS.from_user_input(crs)
+
+ return None
+
Define numpy's histogram options.
+Name | +Type | +Required | +Default | +
---|---|---|---|
histogram_bins | +Query (encoded list of Number) | +No | +10 | +
histogram_range | +Query (encoded list of Number) | +No | +None | +
@dataclass
+class HistogramParams(DefaultDependency):
+ """Numpy Histogram options."""
+
+ bins: Annotated[
+ Optional[str],
+ Query(
+ alias="histogram_bins",
+ title="Histogram bins.",
+ description="""
+Defines the number of equal-width bins in the given range (10, by default).
+
+If bins is a sequence (comma `,` delimited values), it defines a monotonically increasing array of bin edges, including the rightmost edge, allowing for non-uniform bin widths.
+
+link: https://numpy.org/doc/stable/reference/generated/numpy.histogram.html
+ """,
+ openapi_examples={
+ "simple": {
+ "description": "Defines the number of equal-width bins",
+ "value": 8,
+ },
+ "array": {
+ "description": "Defines custom bin edges (comma `,` delimited values)",
+ "value": "0,100,200,300",
+ },
+ },
+ ),
+ ] = None
+
+ range: Annotated[
+ Optional[str],
+ Query(
+ alias="histogram_range",
+ title="Histogram range",
+ description="""
+Comma `,` delimited range of the bins.
+
+The lower and upper range of the bins. If not provided, range is simply (a.min(), a.max()).
+
+Values outside the range are ignored. The first element of the range must be less than or equal to the second.
+range affects the automatic bin computation as well.
+
+link: https://numpy.org/doc/stable/reference/generated/numpy.histogram.html
+ """,
+ examples="0,1000",
+ ),
+ ] = None
+
+ def __post_init__(self):
+ """Post Init."""
+ if self.bins:
+ bins = self.bins.split(",")
+ if len(bins) == 1:
+ self.bins = int(bins[0]) # type: ignore
+ else:
+ self.bins = list(map(float, bins)) # type: ignore
+ else:
+ self.bins = 10
+
+ if self.range:
+ self.range = list(map(float, self.range.split(","))) # type: ignore
+
ImageRenderingParams
¶Control output image rendering options.
+Name | +Type | +Required | +Default | +
---|---|---|---|
return_mask | +Query (bool) | +No | +False | +
@dataclass
+class ImageRenderingParams(DefaultDependency):
+ """Image Rendering options."""
+
+ add_mask: Annotated[
+ bool,
+ Query(
+ alias="return_mask",
+ description="Add mask to the output data. Defaults to `True`",
+ ),
+ ] = True
+
Same as PreviewParams
but without default max_size
.
Name | +Type | +Required | +Default | +
---|---|---|---|
max_size | +Query (int) | +No | +None | +
height | +Query (int) | +No | +None | +
width | +Query (int) | +No | +None | +
@dataclass
+class PartFeatureParams(DefaultDependency):
+ """Common parameters for bbox and feature."""
+
+ max_size: Annotated[Optional[int], "Maximum image size to read onto."] = None
+ height: Annotated[Optional[int], "Force output image height."] = None
+ width: Annotated[Optional[int], "Force output image width."] = None
+
+ def __post_init__(self):
+ """Post Init."""
+ if self.width and self.height:
+ self.max_size = None
+
In titiler.mosaic
, define pixel-selection method to apply.
Name | +Type | +Required | +Default | +
---|---|---|---|
pixel_selection | +Query (str) | +No | +'first' | +
def PixelSelectionParams(
+ pixel_selection: Annotated[ # type: ignore
+ Literal[tuple([e.name for e in PixelSelectionMethod])],
+ Query(description="Pixel selection method."),
+ ] = "first",
+) -> MosaicMethodBase:
+ """
+ Returns the mosaic method used to combine datasets together.
+ """
+ return PixelSelectionMethod[pixel_selection].value()
+
Define image output size.
+Name | +Type | +Required | +Default | +
---|---|---|---|
max_size | +Query (int) | +No | +1024 | +
height | +Query (int) | +No | +None | +
width | +Query (int) | +No | +None | +
@dataclass
+class PreviewParams(DefaultDependency):
+ """Common Preview parameters."""
+
+ max_size: Annotated[int, "Maximum image size to read onto."] = 1024
+ height: Annotated[Optional[int], "Force output image height."] = None
+ width: Annotated[Optional[int], "Force output image width."] = None
+
+ def __post_init__(self):
+ """Post Init."""
+ if self.width and self.height:
+ self.max_size = None
+
RescalingParams
¶Set Min/Max values to rescale from, to 0 -> 255.
+Name | +Type | +Required | +Default | +
---|---|---|---|
rescale | +Query (str, comma delimited Numer) | +No | +None | +
def RescalingParams(
+ rescale: Annotated[
+ Optional[List[str]],
+ Query(
+ title="Min/Max data Rescaling",
+ description="comma (',') delimited Min,Max range. Can set multiple time for multiple bands.",
+ examples=["0,2000", "0,1000", "0,10000"], # band 1 # band 2 # band 3
+ ),
+ ] = None,
+) -> Optional[RescaleType]:
+ """Min/Max data Rescaling"""
+ if rescale:
+ return [tuple(map(float, r.replace(" ", "").split(","))) for r in rescale]
+
+ return None
+
Define options for rio-tiler's statistics method.
+Name | +Type | +Required | +Default | +
---|---|---|---|
categorical | +Query (bool) | +No | +False | +
categories | +Query (list of Number) | +No | +None | +
p | +Query (list of Number) | +No | +[2, 98] | +
@dataclass
+class StatisticsParams(DefaultDependency):
+ """Statistics options."""
+
+ categorical: Annotated[
+ bool,
+ Query(description="Return statistics for categorical dataset."),
+ ] = False
+ categories: Annotated[
+ Optional[List[Union[float, int]]],
+ Query(
+ alias="c",
+ title="Pixels values for categories.",
+ description="List of values for which to report counts.",
+ examples=[1, 2, 3],
+ ),
+ ] = None
+ percentiles: Annotated[
+ Optional[List[int]],
+ Query(
+ alias="p",
+ title="Percentile values",
+ description="List of percentile values (default to [2, 98]).",
+ examples=[2, 5, 95, 98],
+ ),
+ ] = None
+
+ def __post_init__(self):
+ """Set percentiles default."""
+ if not self.percentiles:
+ self.percentiles = [2, 98]
+
Defile buffer
and padding
to apply at tile creation.
Name | +Type | +Required | +Default | +
---|---|---|---|
buffer | +Query (float) | +No | +None | +
padding | +Query (int) | +No | +None | +
@dataclass
+class TileParams(DefaultDependency):
+ """Tile options."""
+
+ buffer: Annotated[
+ Optional[float],
+ Query(
+ gt=0,
+ title="Tile buffer.",
+ description="Buffer on each side of the given tile. It must be a multiple of `0.5`. Output **tilesize** will be expanded to `tilesize + 2 * buffer` (e.g 0.5 = 257x257, 1.0 = 258x258).",
+ ),
+ ] = None
+
+ padding: Annotated[
+ Optional[int],
+ Query(
+ gt=0,
+ title="Tile padding.",
+ description="Padding to apply to each tile edge. Helps reduce resampling artefacts along edges. Defaults to `0`.",
+ ),
+ ] = None
+
algorithm.dependency
¶Control which algorithm
to apply to the data.
Name | +Type | +Required | +Default | +
---|---|---|---|
algorithm | +Query (str) | +No | +None | +
algorithm_params | +Query (encoded json) | +No | +None | +
algorithms = {}
+
+def post_process(
+ algorithm: Annotated[
+ Literal[tuple(algorithms.keys())],
+ Query(description="Algorithm name"),
+ ] = None,
+ algorithm_params: Annotated[
+ Optional[str],
+ Query(description="Algorithm parameter"),
+ ] = None,
+) -> Optional[BaseAlgorithm]:
+ """Data Post-Processing options."""
+ kwargs = json.loads(algorithm_params) if algorithm_params else {}
+ if algorithm:
+ try:
+ return algorithms.get(algorithm)(**kwargs)
+
+ except ValidationError as e:
+ raise HTTPException(status_code=400, detail=str(e)) from e
+
+ return None
+
TiTiler's endpoints factories are helper functions that let users create a FastAPI router (fastapi.APIRouter
) with a minimal set of endpoints.
Important
+Most of tiler
Factories are built around rio_tiler.io.BaseReader
, which defines basic methods to access datasets (e.g COG or STAC). The default reader is Reader
for TilerFactory
and MosaicBackend
for MosaicTilerFactory
.
Factories classes use dependencies injection to define most of the endpoint options.
+class: titiler.core.factory.BaseTilerFactory
Most Factories are built from this abstract based class which is used to define commons attributes and utility functions shared between all factories.
+fastapi.APIRouter
.titiler.core.dependencies.DatasetPathParams
.titiler.core.dependencies.BidxExprParams
.nodata
value, apply rescaling
and change the I/O
or Warp
resamplings. Defaults to titiler.core.dependencies.DatasetParams
.algorithm
to apply to the data. Defaults to titiler.core.algorithm.algorithms.dependency
.titiler.core.dependencies.RescalingParams
.titiler.core.dependencies.ColorFormulaParams
.titiler.core.dependencies.ColorMapParams
titiler.core.dependencies.ImageRenderingParams
titiler.core.dependencies.DefaultDependency
lambda: {}
.morecantile.tms
.TileMatrixSet
identifier to use. Defaults to WebMercatorQuad
.""
.OptionalHeader
which endpoints could add (if implemented). Defaults to []
.[]
.[]
.titiler.core.factory.DEFAULT_TEMPLATES
.class: titiler.core.factory.TilerFactory
Factory meant to create endpoints for single dataset using rio-tiler's Reader
.
Reader
./statistics
endpoints. Defaults to titiler.core.dependencies.StatisticsParams
./statistics
endpoints. Defaults to titiler.core.dependencies.HistogramParams
./preview
and /statistics
endpoints. Defaults to titiler.core.dependencies.PreviewParams
./bbox
and /feature
endpoints. Defaults to titiler.core.dependencies.PartFeatureParams
.buffer
and padding
to apply at tile creation. Defaults to titiler.core.dependencies.TileParams
./preview
endpoint to the router. Defaults to True
./bbox
and /feature
endpoints to the router. Defaults to True
./map
endpoints to the router. Defaults to True
.from fastapi import FastAPI
+
+from titiler.core.factory import TilerFactory
+
+# Create FastAPI application
+app = FastAPI()
+
+# Create router and register set of endpoints
+cog = TilerFactory(
+ add_preview=True,
+ add_part=True,
+ add_viewer=True,
+)
+
+# add router endpoint to the main application
+app.include_router(cog.router)
+
Method | +URL | +Output | +Description | +
---|---|---|---|
GET |
+/bounds |
+JSON (Bounds) | +return dataset's bounds | +
GET |
+/info |
+JSON (Info) | +return dataset's basic info | +
GET |
+/info.geojson |
+GeoJSON (InfoGeoJSON) | +return dataset's basic info as a GeoJSON feature | +
GET |
+/statistics |
+JSON (Statistics) | +return dataset's statistics | +
POST |
+/statistics |
+GeoJSON (Statistics) | +return dataset's statistics for a GeoJSON | +
GET |
+/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}] |
+image/bin | +create a web map tile image from a dataset | +
GET |
+/{tileMatrixSetId}/tilejson.json |
+JSON (TileJSON) | +return a Mapbox TileJSON document | +
GET |
+/{tileMatrixSetId}/WMTSCapabilities.xml |
+XML | +return OGC WMTS Get Capabilities | +
GET |
+/point/{lon},{lat} |
+JSON (Point) | +return pixel values from a dataset | +
GET |
+/preview[.{format}] |
+image/bin | +create a preview image from a dataset Optional | +
GET |
+/bbox/{minx},{miny},{maxx},{maxy}[/{width}x{height}].{format} |
+image/bin | +create an image from part of a dataset Optional | +
POST |
+/feature[/{width}x{height}][.{format}] |
+image/bin | +create an image from a GeoJSON feature Optional | +
GET |
+/{tileMatrixSetId}/map |
+HTML | +return a simple map viewer Optional | +
class: titiler.core.factory.MultiBaseTilerFactory
Custom TilerFactory
to be used with rio_tiler.io.MultiBaseReader
type readers (e.g rio_tiler.io.STACReader
).
MultiBase
Dataset Reader required.titiler.core.dependencies.AssetsBidxExprParams
.titiler.core.dependencies.AssetsParams
.from fastapi import FastAPI
+
+from rio_tiler.io import STACReader # STACReader is a MultiBaseReader
+
+from titiler.core.factory import MultiBaseTilerFactory
+
+app = FastAPI()
+stac = MultiBaseTilerFactory(reader=STACReader)
+app.include_router(stac.router)
+
Method | +URL | +Output | +Description | +
---|---|---|---|
GET |
+/bounds |
+JSON (Bounds) | +return dataset's bounds | +
GET |
+/assets |
+JSON | +return the list of available assets | +
GET |
+/info |
+JSON (Info) | +return assets basic info | +
GET |
+/info.geojson |
+GeoJSON (InfoGeoJSON) | +return assets basic info as a GeoJSON feature | +
GET |
+/asset_statistics |
+JSON (Statistics) | +return per asset statistics | +
GET |
+/statistics |
+JSON (Statistics) | +return assets statistics (merged) | +
POST |
+/statistics |
+GeoJSON (Statistics) | +return assets statistics for a GeoJSON (merged) | +
GET |
+/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}] |
+image/bin | +create a web map tile image from assets | +
GET |
+/{tileMatrixSetId}/tilejson.json |
+JSON (TileJSON) | +return a Mapbox TileJSON document | +
GET |
+/{tileMatrixSetId}/WMTSCapabilities.xml |
+XML | +return OGC WMTS Get Capabilities | +
GET |
+/point/{lon},{lat} |
+JSON (Point) | +return pixel values from assets | +
GET |
+/preview[.{format}] |
+image/bin | +create a preview image from assets Optional | +
GET |
+/bbox/{minx},{miny},{maxx},{maxy}[/{width}x{height}].{format} |
+image/bin | +create an image from part of assets Optional | +
POST |
+/feature[/{width}x{height}][.{format}] |
+image/bin | +create an image from a geojson feature intersecting assets Optional | +
GET |
+/{tileMatrixSetId}/map |
+HTML | +return a simple map viewer Optional | +
class: titiler.core.factory.MultiBandTilerFactory
Custom TilerFactory
to be used with rio_tiler.io.MultiBandReader
type readers.
MultiBands
Dataset Reader required.titiler.core.dependencies.BandsExprParams
.titiler.core.dependencies.BandsParams
.from fastapi import FastAPI, Query
+
+
+from rio_tiler_pds.landsat.aws import LandsatC2Reader # LandsatC2Reader is a MultiBandReader
+from titiler.core.factory import MultiBandTilerFactory
+
+
+def SceneIDParams(
+ sceneid: Annotated[
+ str,
+ Query(description="Landsat Scene ID")
+ ]
+) -> str:
+ """Use `sceneid` in query instead of url."""
+ return sceneid
+
+
+app = FastAPI()
+landsat = MultiBandTilerFactory(reader=LandsatC2Reader, path_dependency=SceneIDParams)
+app.include_router(landsat.router)
+
Method | +URL | +Output | +Description | +
---|---|---|---|
GET |
+/bounds |
+JSON (Bounds) | +return dataset's bounds | +
GET |
+/bands |
+JSON | +return the list of available bands | +
GET |
+/info |
+JSON (Info) | +return basic info for a dataset | +
GET |
+/info.geojson |
+GeoJSON (InfoGeoJSON) | +return basic info for a dataset as a GeoJSON feature | +
GET |
+/statistics |
+JSON (Statistics) | +return info and statistics for a dataset | +
POST |
+/statistics |
+GeoJSON (Statistics) | +return info and statistics for a dataset | +
GET |
+/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}] |
+image/bin | +create a web map tile image from a dataset | +
GET |
+/{tileMatrixSetId}/tilejson.json |
+JSON (TileJSON) | +return a Mapbox TileJSON document | +
GET |
+/{tileMatrixSetId}/WMTSCapabilities.xml |
+XML | +return OGC WMTS Get Capabilities | +
GET |
+/point/{lon},{lat} |
+JSON (Point) | +return pixel value from a dataset | +
GET |
+/preview[.{format}] |
+image/bin | +create a preview image from a dataset Optional | +
GET |
+/bbox/{minx},{miny},{maxx},{maxy}[/{width}x{height}].{format} |
+image/bin | +create an image from part of a dataset Optional | +
POST |
+/feature[/{width}x{height}][.{format}] |
+image/bin | +create an image from a geojson feature Optional | +
GET |
+/{tileMatrixSetId}/map |
+HTML | +return a simple map viewer Optional | +
class: titiler.mosaic.factory.MosaicTilerFactory
Endpoints factory for mosaics, built on top of MosaicJSON.
+BaseBackend
Mosaic Reader required.rio_tiler.io.Reader
titiler.core.dependencies.DefaultDependency
pixel_selection
method. Defaults to titiler.mosaic.factory.PixelSelectionParams
.buffer
and padding
to apply at tile creation. Defaults to titiler.core.dependencies.TileParams
.morecantile.tms
.TileMatrixSet
identifier to use. Defaults to WebMercatorQuad
./map
endpoints to the router. Defaults to True
.Method | +URL | +Output | +Description | +
---|---|---|---|
GET |
+/ |
+JSON MosaicJSON | +return a MosaicJSON document | +
GET |
+/bounds |
+JSON (Bounds) | +return mosaic's bounds | +
GET |
+/info |
+JSON (Info) | +return mosaic's basic info | +
GET |
+/info.geojson |
+GeoJSON (InfoGeoJSON) | +return mosaic's basic info as a GeoJSON feature | +
GET |
+/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}] |
+image/bin | +create a web map tile image from a MosaicJSON | +
GET |
+/{tileMatrixSetId}/tilejson.json |
+JSON (TileJSON) | +return a Mapbox TileJSON document | +
GET |
+/{tileMatrixSetId}/WMTSCapabilities.xml |
+XML | +return OGC WMTS Get Capabilities | +
GET |
+/point/{lon},{lat} |
+JSON (Point) | +return pixel value from a MosaicJSON dataset | +
GET |
+/{z}/{x}/{y}/assets |
+JSON | +return list of assets intersecting a XYZ tile | +
GET |
+/{lon},{lat}/assets |
+JSON | +return list of assets intersecting a point | +
GET |
+/{minx},{miny},{maxx},{maxy}/assets |
+JSON | +return list of assets intersecting a bounding box | +
GET |
+/{tileMatrixSetId}/map |
+HTML | +return a simple map viewer Optional | +
class: titiler.core.factory.TMSFactory
Endpoints factory for OGC TileMatrixSets
.
morecantile.tms
.from fastapi import FastAPI
+
+from titiler.core.factory import TMSFactory
+
+app = FastAPI()
+tms = TMSFactory()
+app.include_router(tms.router)
+
Method | +URL | +Output | +Description | +
---|---|---|---|
GET |
+/tileMatrixSets |
+JSON (TileMatrixSetList) | +retrieve the list of available tiling schemes (tile matrix sets) | +
GET |
+/tileMatrixSets/{tileMatrixSetId} |
+JSON (TileMatrixSet) | +retrieve the definition of the specified tiling scheme (tile matrix set) | +
class: titiler.core.factory.AlgorithmFactory
Endpoints factory for custom algorithms.
+Algorithm
. Defaults to titiler.core.algorithm.algorithms
.from fastapi import FastAPI
+
+from titiler.core.factory import AlgorithmFactory
+
+app = FastAPI()
+algo = AlgorithmFactory()
+app.include_router(algo.router)
+
Method | +URL | +Output | +Description | +
---|---|---|---|
GET |
+/algorithms |
+JSON (Dict of Algorithm Metadata) | +retrieve the list of available Algorithms | +
GET |
+/algorithms/{algorithmId} |
+JSON (Algorithm Metadata) | +retrieve the metadata of the specified algorithm. | +
class: titiler.core.factory.ColorMapFactory
Endpoints factory for colorMaps metadata.
+ColorMaps
. Defaults to rio_tiler.colormap.cmap
.from fastapi import FastAPI
+
+from titiler.core.factory import ColorMapFactory
+
+app = FastAPI()
+colormap = ColorMapFactory()
+app.include_router(colormap.router)
+
Method | +URL | +Output | +Description | +
---|---|---|---|
GET |
+/colorMaps |
+JSON (colorMapList) | +retrieve the list of available colorMaps | +
GET |
+/colorMaps/{colorMapId} |
+JSON (colorMap) | +retrieve the metadata or image of the specified colorMap. | +
Titiler makes use of several great underlying libraries, including GDAL +and Python bindings to GDAL. An effective deployment of titiler +generally requires tweaking GDAL configuration settings. This document provides +an overview of relevant settings. Full documentation from GDAL is available +here.
+GDAL configuration is modified using environment variables. Thus in order to +change a setting you'll need to set environment variables through your +deployment mechanism. For example, in order to test locally you'd set an +environment variable in bash:
+export GDAL_HTTP_MULTIPLEX=YES
+
GDAL_HTTP_MERGE_CONSECUTIVE_RANGES
¶When set to YES
, this tells GDAL to merge adjacent range requests. Instead of
+making two requests for byte ranges 1-5
and 6-10
, it would make a single
+request for 1-10
. This should always be set to YES
.
GDAL_DISABLE_READDIR_ON_OPEN
¶This is a very important setting to control the number of requests GDAL makes.
+This setting has two options: FALSE
and EMPTY_DIR
. FALSE
(the default)
+causes GDAL to try to establish a list of all the available files in the
+directory. EMPTY_DIR
tells GDAL to imagine that the directory is empty except
+for the requested file.
When reading datasets with necessary external sidecar files, it's imperative to
+set FALSE
. For example, the landsat-pds
bucket on AWS S3 contains GeoTIFF
+images where overviews are in external .ovr
files. If set to EMPTY_DIR
, GDAL
+won't find the .ovr
files.
However, in all other cases, it's much better to set EMPTY_DIR
because this
+prevents GDAL from making a LIST
request.
This setting also has cost implications for reading data from requester-pays
+buckets. When set to FALSE
, GDAL makes a LIST
request every time it opens a
+file. Since LIST
requests are much more expensive than GET
requests, this
+can bring unexpected costs.
CPL_VSIL_CURL_ALLOWED_EXTENSIONS
¶A list of file extensions that GDAL is allowed to open. For example if set to
+.tif
, then GDAL would only open files with a .tif
extension. For example, it
+would fail on JPEG2000 files with a .jp2
extension, but also wouldn't open
+GeoTIFFs exposed through an API endpoint that don't have a .tif
suffix.
Note that you also need to include extensions of external overview files. For
+example, the landsat-pds
bucket on AWS S3 has external overviews in .ovr
+files, so if you wished to read this data, you'd want
GDAL_INGESTED_BYTES_AT_OPEN
¶Gives the number of initial bytes GDAL should read when opening a file and +inspecting its metadata.
+Titiler works best with Cloud-Optimized GeoTIFFs (COGs) because they have a +tiled internal structure that supports efficient random reads. These files have +an initial metadata section that describes the location (byte range) within the +file of each internal tile. The more internal tiles the COG has, the more data +the header needs to contain.
+GDAL needs to read the entire header before it can read any other portion of the +file. By default GDAL reads the first 16KB of the file, then if that doesn't +contain the entire metadata, it makes one more request for the rest of the +metadata.
+In environments where latency is relatively high (at least compared to +bandwidth), such as AWS S3, it may be beneficial to increase this value +depending on the data you expect to read.
+There isn't currently a way to get the number of header bytes using GDAL, but
+alternative GeoTIFF readers such as aiocogeo
can. Using its cli
+you can find the image's header size:
export AWS_REQUEST_PAYER="requester"
+aiocogeo info s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2020/072/076/LC08_L2SR_072076_20201203_20210313_02_T2/LC08_L2SR_072076_20201203_20210313_02_T2_SR_B1.TIF
+
+ PROFILE
+ ...
+ Header size: 32770
+
It's wise to inspect the header sizes of your data sources, and set
+GDAL_INGESTED_BYTES_AT_OPEN
appropriately. Beware, however, that the given
+number of bytes will be read for every image, so you don't want to make the
+value too large.
GDAL_CACHEMAX
¶Default GDAL block cache. The value can be either in Mb, bytes or percent of the physical RAM
+Recommended: 200 (200Mb)
+CPL_VSIL_CURL_CACHE_SIZE
¶A global least-recently-used cache shared among all downloaded content and may be reused after a file handle has been closed and reopen
+Recommended: 200000000 (200Mb)
+VSI_CACHE
¶Setting this to TRUE
enables GDAL to use an internal caching mechanism. It's
Recommended (Strongly): TRUE.
+VSI_CACHE_SIZE
¶The size of the above VSI cache in bytes per-file handle. If you open a VRT with 10 files and your VSI_CACHE_SIZE is 10 bytes, the total cache memory usage would be 100 bytes. +The cache is RAM based and the content of the cache is discarded when the file handle is closed.
+Recommended: 5000000 (5Mb per file handle)
+GDAL_BAND_BLOCK_CACHE
¶GDAL Block Cache type: ARRAY
or HASHSET
. See gdal.org/development/rfc/rfc26_blockcache.html
PROJ_NETWORK
¶Introduced with GDAL 3 and PROJ>7, the PROJ library can fetch more precise transformation grids hosted on the cloud.
+Values: ON/OFF
+Ref: proj.org/usage/network.html
+GDAL_HTTP_MULTIPLEX
¶When set to YES
, this attempts to download multiple range requests in
+parallel, reusing the same TCP connection. Note this is only possible when the
+server supports HTTP2, which many servers don't yet support. There's no
+downside to setting YES
here.
GDAL_DATA
¶The GDAL_DATA
variable tells rasterio/GDAL where the GDAL C libraries have been installed. When using rasterio wheels, GDAL_DATA must be unset.
PROJ_LIB
¶The PROJ_LIB
variable tells rasterio/GDAL where the PROJ C libraries have been installed. When using rasterio wheels, PROJ_LIB must be unset.
AWS_REQUEST_PAYER
¶CPL_VSIL_CURL_ALLOWED_EXTENSIONS=".tif,.TIF,.tiff"
In addition to GDAL_DISABLE_READDIR_ON_OPEN
, we set the allowed extensions to .tif
to only enable tif files. (OPTIONAL)
GDAL_CACHEMAX="200"
200 Mb Cache.
+CPL_VSIL_CURL_CACHE_SIZE="200000000
200 Mb VSI Cache.
+GDAL_BAND_BLOCK_CACHE="HASHSET"
GDAL_DISABLE_READDIR_ON_OPEN="EMPTY_DIR"
Maybe the most important variable. Setting it to EMPTY_DIR
reduce the number of GET/LIST requests.
GDAL_HTTP_MERGE_CONSECUTIVE_RANGES="YES"
Tells GDAL to merge consecutive range GET requests.
+GDAL_HTTP_MULTIPLEX="YES"
GDAL_HTTP_VERSION="2"
Both Multiplex and HTTP_VERSION will only have impact if the files are stored in an environment which support HTTP 2 (e.g cloudfront).
+VSI_CACHE="TRUE"
VSI_CACHE_SIZE="5000000"
5Mb cache per file handle.
+ + + + + + + + + + + + + + + + + + +When using Titiler to visualize imagery, there are some helper options that change how the data appears on the screen. You can:
+Color maps are arrays of colors, used to map pixel values to specific colors. For example, it is possible to map a single band DEM, where pixel values denote height, to a color map which shows higher values as white:
+ +Titiler supports both default colormaps (each with a name) and custom color maps.
+Default colormaps pre-made, each with a given name. These maps come from the rio-tiler
library, which has taken colormaps packaged with Matplotlib and has added others that are commonly used with raster data.
A list of available color maps can be found in Titiler's Swagger docs, or in the rio-tiler documentation.
+To use a default colormap, simply use the parameter colormap_name
:
import httpx
+
+resp = httpx.get(
+ "https://titiler.xyz/cog/preview",
+ params={
+ "url": "<YOUR DATASET URL HERE>",
+ "colormap_name": "<YOUR COLORMAP NAME HERE>" # e.g. autumn_r
+ }
+)
+
You can take any of the colormaps listed on rio-tiler
, and add _r
to reverse it.
If you'd like to specify your own colormap, you can specify your own using an encoded JSON:
+import httpx
+
+response = httpx.get(
+ "https://titiler.xyz/cog/preview",
+ params={
+ "url": "<YOUR DATASET URL HERE>",
+ "bidx": "1",
+ "colormap": json.dumps({
+ "0": "#e5f5f9",
+ "10": "#99d8c9",
+ "255": "#2ca25f",
+ })
+ }
+)
+
Titiler supports colormaps that are both discrete (where pixels will be one of the colors that you specify) and linear (where pixel colors will blend between the given colors).
+For more information, please check out rio-tiler's docs.
+It is also possible to add a colormap dependency to automatically apply +a default colormap.
+Color formulae are simple commands that apply color corrections to images. This is useful for reducing artefacts like atmospheric haze, dark shadows, or muted colors.
+Titiler supports color formulae as defined in Mapbox's rio-color
plugin. These include the operations (taken from the rio-color
docs):
Gamma adjustment adjusts RGB values according to a power law, effectively brightening or darkening the midtones. It can be very effective in satellite imagery for reducing atmospheric haze in the blue and green bands.
+Sigmoidal contrast adjustment can alter the contrast and brightness of an image in a way that matches human's non-linear visual perception. It works well to increase contrast without blowing out the very dark shadows or already-bright parts of the image.
+Saturation can be thought of as the "colorfulness" of a pixel. Highly saturated colors are intense and almost cartoon-like, low saturation is more muted, closer to black and white. You can adjust saturation independently of brightness and hue but the data must be transformed into a different color space.
+In Titiler, color_formulae are applied through the color_formula
parameter as a string. An example of this option in action:
import httpx
+
+response = httpx.get(
+ "https://titiler.xyz/cog/preview",
+ params={
+ "url": "<YOUR DATASET URL HERE>",
+ "color_formula": "gamma rg 1.3, sigmoidal rgb 22 0.1, saturation 1.5"
+ }
+)
+
Rescaling is the act of adjusting the minimum and maximum values when rendering an image. In an image with a single band, the rescaled minimum value will be set to black, and the rescaled maximum value will be set to white. This is useful if you want to accentuate features that only appear at a certain pixel value (e.g. you have a DEM, but you want to highlight how the terrain changes between sea level and 100m).
+All titiler endpoinds returning image support rescale
parameter. The parameter should be in form of "rescale={min},{max}"
.
import httpx
+
+response = httpx.get(
+ "https;//titiler.xyz/cog/preview",
+ params={
+ "url": "<YOUR DATASET URL HERE>",
+ "rescale": "0,100",
+ },
+)
+
Titiler supports rescaling on a per-band basis, using multiple rescale
parameters.
import httpx
+
+response = httpx.get(
+ "https;//titiler.xyz/cog/preview",
+ params=(
+ ("url", "<YOUR DATASET URL HERE>"),
+ ("rescale", "0,100"),
+ ("rescale", "0,1000"),
+ ("rescale", "0,10000"),
+ ),
+)
+
By default, Titiler will rescale the bands using the min/max values of the input datatype. For example, PNG images 8- or 16-bit unsigned pixels, +giving a possible range of 0 to 255 or 0 to 65,536, so Titiler will use these ranges to rescale to the output format.
+For certain datasets (e.g. DEMs) this default behaviour can make the image seem washed out (or even entirely one color), +so if you see this happen look into rescaling your images to something that makes sense for your data.
+It is also possible to add a rescaling dependency to automatically apply +a default rescale.
+ + + + + + + + + + + + + + + + + + +Common dependency.
+RescaleType
+
def BufferParams(
+ buffer: Annotated[Optional[float], Query(PydanticUndefined)] = None
+) -> Optional[float]
+
Tile buffer Parameter.
+def ColorFormulaParams(
+ color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[str]
+
ColorFormula Parameter.
+def ColorMapParams(
+ colormap_name: Annotated[Literal['flag_r', 'gist_earth_r', 'cool', 'rdpu_r', 'matter_r', 'tempo_r', 'brbg', 'bwr_r', 'wistia', 'gist_yarg', 'ylgn', 'tarn_r', 'puor', 'purd', 'bupu', 'viridis_r', 'rdylbu_r', 'thermal_r', 'purples_r', 'gnuplot', 'winter', 'twilight_shifted_r', 'gnuplot_r', 'prism', 'viridis', 'pubugn_r', 'oxy', 'haline', 'ylorbr', 'winter_r', 'solar', 'gist_heat', 'rdylbu', 'dark2', 'dark2_r', 'terrain_r', 'set3', 'gray_r', 'tab20_r', 'brbg_r', 'rdylgn', 'twilight', 'balance_r', 'summer', 'hot', 'turbid', 'diff', 'speed', 'cmrmap', 'set3_r', 'pastel1', 'piyg_r', 'deep', 'greens_r', 'inferno_r', 'curl_r', 'pubugn', 'seismic_r', 'cmrmap_r', 'hsv_r', 'ylorrd', 'dense', 'oxy_r', 'bwr', 'bone', 'set1_r', 'pastel2', 'reds', 'delta_r', 'gist_rainbow_r', 'orrd_r', 'phase_r', 'pink', 'rainbow_r', 'set2_r', 'bugn', 'ocean', 'copper', 'gist_ncar', 'cubehelix', 'spring_r', 'cool_r', 'ocean_r', 'thermal', 'tab10_r', 'cividis', 'nipy_spectral', 'copper_r', 'inferno', 'amp_r', 'speed_r', 'tab10', 'gist_earth', 'prism_r', 'rdylgn_r', 'twilight_shifted', 'pubu', 'prgn_r', 'gist_gray', 'gray', 'pubu_r', 'purd_r', 'jet', 'flag', 'ice_r', 'tab20c_r', 'paired_r', 'cividis_r', 'gnbu_r', 'autumn_r', 'cfastie', 'spring', 'magma_r', 'rain_r', 'bugn_r', 'afmhot', 'pastel2_r', 'brg_r', 'puor_r', 'nipy_spectral_r', 'gist_stern', 'phase', 'deep_r', 'tempo', 'gist_ncar_r', 'amp', 'balance', 'spectral', 'cubehelix_r', 'delta', 'rain', 'diff_r', 'magma', 'greens', 'reds_r', 'gist_heat_r', 'piyg', 'set1', 'topo_r', 'bone_r', 'binary_r', 'tab20c', 'rdgy_r', 'wistia_r', 'topo', 'algae_r', 'autumn', 'gist_yarg_r', 'ylorrd_r', 'rdbu_r', 'pink_r', 'paired', 'matter', 'terrain', 'twilight_r', 'oranges', 'brg', 'ylgnbu_r', 'purples', 'set2', 'plasma', 'ylorbr_r', 'spectral_r', 'plasma_r', 'coolwarm', 'turbo_r', 'binary', 'schwarzwald', 'rdpu', 'greys_r', 'coolwarm_r', 'tarn', 'algae', 'oranges_r', 'rainbow', 'orrd', 'curl', 'accent', 'rplumbo', 'afmhot_r', 'turbo', 'hsv', 'ylgn_r', 'blues', 'tab20b', 'accent_r', 'ice', 'gist_stern_r', 'blues_r', 'rdbu', 'hot_r', 'jet_r', 'seismic', 'summer_r', 'ylgnbu', 'tab20b_r', 'pastel1_r', 'rdgy', 'gist_rainbow', 'dense_r', 'turbid_r', 'bupu_r', 'solar_r', 'gnbu', 'prgn', 'greys', 'tab20', 'haline_r', 'gist_gray_r', 'gnuplot2_r', 'gnuplot2'], Query(PydanticUndefined)] = None,
+ colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
def CoordCRSParams(
+ crs: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[rasterio.crs.CRS]
+
Coordinate Reference System Coordinates Param.
+def DatasetPathParams(
+ url: typing.Annotated[str, Query(PydanticUndefined)]
+) -> str
+
Create dataset path from args
+def DstCRSParams(
+ crs: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[rasterio.crs.CRS]
+
Coordinate Reference System Coordinates Param.
+def RescalingParams(
+ rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
+) -> Optional[List[Tuple[float, ...]]]
+
Min/Max data Rescaling
+def create_colormap_dependency(
+ cmap: rio_tiler.colormap.ColorMaps
+) -> Callable
+
Create Colormap Dependency.
+def parse_asset_expression(
+ asset_expression: Union[Sequence[str], Dict[str, str]]
+) -> Dict[str, str]
+
parse asset expression parameters.
+def parse_asset_indexes(
+ asset_indexes: Union[Sequence[str], Dict[str, Sequence[int]]]
+) -> Dict[str, Sequence[int]]
+
parse asset indexes parameters.
+class AssetsBidxExprParams(
+ indexes: Annotated[Optional[List[int]], Query(PydanticUndefined)] = None,
+ assets: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None,
+ expression: Annotated[Optional[str], Query(PydanticUndefined)] = None,
+ asset_indexes: Annotated[Optional[Sequence[str]], Query(PydanticUndefined)] = None,
+ asset_as_band: Annotated[Optional[bool], Query(PydanticUndefined)] = None
+)
+
Assets, Expression and Asset's band Indexes parameters.
+asset_as_band
+
asset_indexes
+
assets
+
expression
+
indexes
+
def keys(
+ self
+)
+
Return Keys.
+class AssetsBidxExprParamsOptional(
+ indexes: Annotated[Optional[List[int]], Query(PydanticUndefined)] = None,
+ assets: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None,
+ expression: Annotated[Optional[str], Query(PydanticUndefined)] = None,
+ asset_indexes: Annotated[Optional[Sequence[str]], Query(PydanticUndefined)] = None,
+ asset_as_band: Annotated[Optional[bool], Query(PydanticUndefined)] = None
+)
+
Assets, Expression and Asset's band Indexes parameters but with no requirement.
+asset_as_band
+
asset_indexes
+
assets
+
expression
+
indexes
+
def keys(
+ self
+)
+
Return Keys.
+class AssetsBidxParams(
+ indexes: Annotated[Optional[List[int]], Query(PydanticUndefined)] = None,
+ assets: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None,
+ asset_indexes: Annotated[Optional[Sequence[str]], Query(PydanticUndefined)] = None,
+ asset_expression: Annotated[Optional[Sequence[str]], Query(PydanticUndefined)] = None
+)
+
Assets, Asset's band Indexes and Asset's band Expression parameters.
+asset_expression
+
asset_indexes
+
assets
+
indexes
+
def keys(
+ self
+)
+
Return Keys.
+class AssetsParams(
+ assets: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
+)
+
Assets parameters.
+assets
+
def keys(
+ self
+)
+
Return Keys.
+class BandsExprParams(
+ bands: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None,
+ expression: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
Band names and Expression parameters (Band or Expression required).
+bands
+
expression
+
def keys(
+ self
+)
+
Return Keys.
+class BandsExprParamsOptional(
+ bands: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None,
+ expression: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
Optional Band names and Expression parameters.
+bands
+
expression
+
def keys(
+ self
+)
+
Return Keys.
+class BandsParams(
+ bands: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
+)
+
Band names parameters.
+bands
+
def keys(
+ self
+)
+
Return Keys.
+class BidxExprParams(
+ indexes: Annotated[Optional[List[int]], Query(PydanticUndefined)] = None,
+ expression: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
Band Indexes and Expression parameters.
+expression
+
indexes
+
def keys(
+ self
+)
+
Return Keys.
+class BidxParams(
+ indexes: Annotated[Optional[List[int]], Query(PydanticUndefined)] = None
+)
+
Band Indexes parameters.
+indexes
+
def keys(
+ self
+)
+
Return Keys.
+class DatasetParams(
+ nodata: Annotated[Union[str, int, float, NoneType], Query(PydanticUndefined)] = None,
+ unscale: typing.Annotated[bool, Query(PydanticUndefined)] = False,
+ resampling_method: Annotated[Literal['nearest', 'bilinear', 'cubic', 'cubic_spline', 'lanczos', 'average', 'mode', 'gauss', 'rms'], Query(PydanticUndefined)] = 'nearest',
+ reproject_method: Annotated[Literal['nearest', 'bilinear', 'cubic', 'cubic_spline', 'lanczos', 'average', 'mode', 'sum', 'rms'], Query(PydanticUndefined)] = 'nearest'
+)
+
Low level WarpedVRT Optional parameters.
+nodata
+
reproject_method
+
resampling_method
+
unscale
+
def keys(
+ self
+)
+
Return Keys.
+class DefaultDependency(
+
+)
+
Dataclass with dict unpacking
+def keys(
+ self
+)
+
Return Keys.
+class ExpressionParams(
+ expression: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
Expression parameters.
+expression
+
def keys(
+ self
+)
+
Return Keys.
+class HistogramParams(
+ bins: Annotated[Optional[str], Query(PydanticUndefined)] = None,
+ range: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
Numpy Histogram options.
+bins
+
range
+
def keys(
+ self
+)
+
Return Keys.
+class ImageRenderingParams(
+ add_mask: typing.Annotated[bool, Query(PydanticUndefined)] = True
+)
+
Image Rendering options.
+add_mask
+
def keys(
+ self
+)
+
Return Keys.
+class PartFeatureParams(
+ max_size: Annotated[Optional[int], 'Maximum image size to read onto.'] = None,
+ height: Annotated[Optional[int], 'Force output image height.'] = None,
+ width: Annotated[Optional[int], 'Force output image width.'] = None
+)
+
Common parameters for bbox and feature.
+height
+
max_size
+
width
+
def keys(
+ self
+)
+
Return Keys.
+class PreviewParams(
+ max_size: typing.Annotated[int, 'Maximum image size to read onto.'] = 1024,
+ height: Annotated[Optional[int], 'Force output image height.'] = None,
+ width: Annotated[Optional[int], 'Force output image width.'] = None
+)
+
Common Preview parameters.
+height
+
max_size
+
width
+
def keys(
+ self
+)
+
Return Keys.
+class StatisticsParams(
+ categorical: typing.Annotated[bool, Query(PydanticUndefined)] = False,
+ categories: Annotated[Optional[List[Union[float, int]]], Query(PydanticUndefined)] = None,
+ percentiles: Annotated[Optional[List[int]], Query(PydanticUndefined)] = None
+)
+
Statistics options.
+categorical
+
categories
+
percentiles
+
def keys(
+ self
+)
+
Return Keys.
+class TileParams(
+ buffer: Annotated[Optional[float], Query(PydanticUndefined)] = None,
+ padding: Annotated[Optional[int], Query(PydanticUndefined)] = None
+)
+
Tile options.
+buffer
+
padding
+
def keys(
+ self
+)
+
Return Keys.
+ + + + + + + + + + + + + + + + + + +Titiler error classes.
+DEFAULT_STATUS_CODES
+
def add_exception_handlers(
+ app: fastapi.applications.FastAPI,
+ status_codes: Dict[Type[Exception], int]
+) -> None
+
Add exception handlers to the FastAPI app.
+def exception_handler_factory(
+ status_code: int
+) -> Callable
+
Create a FastAPI exception handler from a status code.
+class BadRequestError(
+ /,
+ *args,
+ **kwargs
+)
+
Bad request error.
+args
+
def add_note(
+ ...
+)
+
Exception.add_note(note) --
+add a note to the exception
+def with_traceback(
+ ...
+)
+
Exception.with_traceback(tb) --
+set self.traceback to tb and return self.
+class TileNotFoundError(
+ /,
+ *args,
+ **kwargs
+)
+
Tile not found error.
+args
+
def add_note(
+ ...
+)
+
Exception.add_note(note) --
+add a note to the exception
+def with_traceback(
+ ...
+)
+
Exception.with_traceback(tb) --
+set self.traceback to tb and return self.
+class TilerError(
+ /,
+ *args,
+ **kwargs
+)
+
Base exception class.
+args
+
def add_note(
+ ...
+)
+
Exception.add_note(note) --
+add a note to the exception
+def with_traceback(
+ ...
+)
+
Exception.with_traceback(tb) --
+set self.traceback to tb and return self.
+ + + + + + + + + + + + + + + + + + +TiTiler Router factories.
+DEFAULT_TEMPLATES
+
WGS84_CRS
+
img_endpoint_params
+
jinja2_env
+
class AlgorithmFactory(
+ supported_algorithm: titiler.core.algorithm.Algorithms = Algorithms(data={'hillshade': <class 'titiler.core.algorithm.dem.HillShade'>, 'contours': <class 'titiler.core.algorithm.dem.Contours'>, 'normalizedIndex': <class 'titiler.core.algorithm.index.NormalizedIndex'>, 'terrarium': <class 'titiler.core.algorithm.dem.Terrarium'>, 'terrainrgb': <class 'titiler.core.algorithm.dem.TerrainRGB'>}),
+ router: fastapi.routing.APIRouter = <factory>
+)
+
Algorithm endpoints Factory.
+supported_algorithm
+
class BaseTilerFactory(
+ reader: Type[rio_tiler.io.base.BaseReader],
+ router: fastapi.routing.APIRouter = <factory>,
+ path_dependency: Callable[..., Any] = <function DatasetPathParams at 0x7fa02174f920>,
+ layer_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.BidxExprParams'>,
+ dataset_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DatasetParams'>,
+ process_dependency: Callable[..., Optional[titiler.core.algorithm.base.BaseAlgorithm]] = <function Algorithms.dependency.<locals>.post_process at 0x7fa017ea3600>,
+ rescale_dependency: Callable[..., Optional[List[Tuple[float, ...]]]] = <function RescalingParams at 0x7fa018242980>,
+ color_formula_dependency: Callable[..., Optional[str]] = <function ColorFormulaParams at 0x7fa018265580>,
+ colormap_dependency: Callable[..., Union[Dict[int, Tuple[int, int, int, int]], Sequence[Tuple[Tuple[Union[float, int], Union[float, int]], Tuple[int, int, int, int]]], NoneType]] = <function create_colormap_dependency.<locals>.deps at 0x7fa02233f560>,
+ render_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.ImageRenderingParams'>,
+ reader_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DefaultDependency'>,
+ environment_dependency: Callable[..., Dict] = <function BaseTilerFactory.<lambda> at 0x7fa017f18400>,
+ supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WGS1984Quad.json'), 'WebMercatorQuad': <TileMatrixSet title='Google Maps Compatible for the World' id='WebMercatorQuad' crs='http://www.opengis.net/def/crs/EPSG/0/3857>, 'WorldCRS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
+ default_tms: Optional[str] = None,
+ router_prefix: str = '',
+ optional_headers: List[titiler.core.resources.enums.OptionalHeader] = <factory>,
+ route_dependencies: List[Tuple[List[titiler.core.routing.EndpointScope], List[fastapi.params.Depends]]] = <factory>,
+ extensions: List[titiler.core.factory.FactoryExtension] = <factory>,
+ templates: starlette.templating.Jinja2Templates = <starlette.templating.Jinja2Templates object at 0x7fa017fd2b50>
+)
+
BaseTiler Factory.
+Abstract Base Class which defines most inputs used by dynamic tiler.
+Name | +Type | +Description | +Default | +
---|---|---|---|
reader | +rio_tiler.io.base.BaseReader | +A rio-tiler reader (e.g Reader). | +None | +
router | +fastapi.APIRouter | +Application router to register endpoints to. | +None | +
path_dependency | +Callable | +Endpoint dependency defining path to pass to the reader init. |
+None | +
dataset_dependency | +titiler.core.dependencies.DefaultDependency | +Endpoint dependency defining dataset overwriting options (e.g nodata). | +None | +
layer_dependency | +titiler.core.dependencies.DefaultDependency | +Endpoint dependency defining dataset indexes/bands/assets options. | +None | +
render_dependency | +titiler.core.dependencies.DefaultDependency | +Endpoint dependency defining image rendering options (e.g add_mask). | +None | +
colormap_dependency | +Callable | +Endpoint dependency defining ColorMap options (e.g colormap_name). | +None | +
process_dependency | +titiler.core.dependencies.DefaultDependency | +Endpoint dependency defining image post-processing options (e.g rescaling, color-formula). | +None | +
tms_dependency | +Callable | +Endpoint dependency defining TileMatrixSet to use. | +None | +
reader_dependency | +titiler.core.dependencies.DefaultDependency | +Endpoint dependency defining BaseReader options. | +None | +
environment_dependency | +Callable | +Endpoint dependency to define GDAL environment at runtime. | +None | +
router_prefix | +str | +prefix where the router will be mounted in the application. | +None | +
optional_headers | +sequence of titiler.core.resources.enums.OptionalHeader | +additional headers to return with the response. | +None | +
dataset_dependency
+
default_tms
+
layer_dependency
+
reader_dependency
+
render_dependency
+
router_prefix
+
supported_tms
+
templates
+
def add_route_dependencies(
+ self,
+ *,
+ scopes: List[titiler.core.routing.EndpointScope],
+ dependencies=typing.List[fastapi.params.Depends]
+)
+
Add dependencies to routes.
+Allows a developer to add dependencies to a route after the route has been defined.
+def color_formula_dependency(
+ color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[str]
+
ColorFormula Parameter.
+def colormap_dependency(
+ colormap_name: Annotated[Literal['flag_r', 'gist_earth_r', 'cool', 'rdpu_r', 'matter_r', 'tempo_r', 'brbg', 'bwr_r', 'wistia', 'gist_yarg', 'ylgn', 'tarn_r', 'puor', 'purd', 'bupu', 'viridis_r', 'rdylbu_r', 'thermal_r', 'purples_r', 'gnuplot', 'winter', 'twilight_shifted_r', 'gnuplot_r', 'prism', 'viridis', 'pubugn_r', 'oxy', 'haline', 'ylorbr', 'winter_r', 'solar', 'gist_heat', 'rdylbu', 'dark2', 'dark2_r', 'terrain_r', 'set3', 'gray_r', 'tab20_r', 'brbg_r', 'rdylgn', 'twilight', 'balance_r', 'summer', 'hot', 'turbid', 'diff', 'speed', 'cmrmap', 'set3_r', 'pastel1', 'piyg_r', 'deep', 'greens_r', 'inferno_r', 'curl_r', 'pubugn', 'seismic_r', 'cmrmap_r', 'hsv_r', 'ylorrd', 'dense', 'oxy_r', 'bwr', 'bone', 'set1_r', 'pastel2', 'reds', 'delta_r', 'gist_rainbow_r', 'orrd_r', 'phase_r', 'pink', 'rainbow_r', 'set2_r', 'bugn', 'ocean', 'copper', 'gist_ncar', 'cubehelix', 'spring_r', 'cool_r', 'ocean_r', 'thermal', 'tab10_r', 'cividis', 'nipy_spectral', 'copper_r', 'inferno', 'amp_r', 'speed_r', 'tab10', 'gist_earth', 'prism_r', 'rdylgn_r', 'twilight_shifted', 'pubu', 'prgn_r', 'gist_gray', 'gray', 'pubu_r', 'purd_r', 'jet', 'flag', 'ice_r', 'tab20c_r', 'paired_r', 'cividis_r', 'gnbu_r', 'autumn_r', 'cfastie', 'spring', 'magma_r', 'rain_r', 'bugn_r', 'afmhot', 'pastel2_r', 'brg_r', 'puor_r', 'nipy_spectral_r', 'gist_stern', 'phase', 'deep_r', 'tempo', 'gist_ncar_r', 'amp', 'balance', 'spectral', 'cubehelix_r', 'delta', 'rain', 'diff_r', 'magma', 'greens', 'reds_r', 'gist_heat_r', 'piyg', 'set1', 'topo_r', 'bone_r', 'binary_r', 'tab20c', 'rdgy_r', 'wistia_r', 'topo', 'algae_r', 'autumn', 'gist_yarg_r', 'ylorrd_r', 'rdbu_r', 'pink_r', 'paired', 'matter', 'terrain', 'twilight_r', 'oranges', 'brg', 'ylgnbu_r', 'purples', 'set2', 'plasma', 'ylorbr_r', 'spectral_r', 'plasma_r', 'coolwarm', 'turbo_r', 'binary', 'schwarzwald', 'rdpu', 'greys_r', 'coolwarm_r', 'tarn', 'algae', 'oranges_r', 'rainbow', 'orrd', 'curl', 'accent', 'rplumbo', 'afmhot_r', 'turbo', 'hsv', 'ylgn_r', 'blues', 'tab20b', 'accent_r', 'ice', 'gist_stern_r', 'blues_r', 'rdbu', 'hot_r', 'jet_r', 'seismic', 'summer_r', 'ylgnbu', 'tab20b_r', 'pastel1_r', 'rdgy', 'gist_rainbow', 'dense_r', 'turbid_r', 'bupu_r', 'solar_r', 'gnbu', 'prgn', 'greys', 'tab20', 'haline_r', 'gist_gray_r', 'gnuplot2_r', 'gnuplot2'], Query(PydanticUndefined)] = None,
+ colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
def environment_dependency(
+
+)
+
def path_dependency(
+ url: typing.Annotated[str, Query(PydanticUndefined)]
+) -> str
+
Create dataset path from args
+def process_dependency(
+ algorithm: Annotated[Literal['hillshade', 'contours', 'normalizedIndex', 'terrarium', 'terrainrgb'], Query(PydanticUndefined)] = None,
+ algorithm_params: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[titiler.core.algorithm.base.BaseAlgorithm]
+
Data Post-Processing options.
+def register_routes(
+ self
+)
+
Register Tiler Routes.
+def rescale_dependency(
+ rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
+) -> Optional[List[Tuple[float, ...]]]
+
Min/Max data Rescaling
+def url_for(
+ self,
+ request: starlette.requests.Request,
+ name: str,
+ **path_params: Any
+) -> str
+
Return full url (with prefix) for a specific endpoint.
+class ColorMapFactory(
+ supported_colormaps: rio_tiler.colormap.ColorMaps = ColorMaps(data={'flag_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/flag_r.npy', 'gist_earth_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_earth_r.npy', 'cool': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cool.npy', 'rdpu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdpu_r.npy', 'matter_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/matter_r.npy', 'tempo_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tempo_r.npy', 'brbg': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/brbg.npy', 'bwr_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bwr_r.npy', 'wistia': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/wistia.npy', 'gist_yarg': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_yarg.npy', 'ylgn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylgn.npy', 'tarn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tarn_r.npy', 'puor': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/puor.npy', 'purd': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/purd.npy', 'bupu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bupu.npy', 'viridis_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/viridis_r.npy', 'rdylbu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdylbu_r.npy', 'thermal_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/thermal_r.npy', 'purples_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/purples_r.npy', 'gnuplot': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnuplot.npy', 'winter': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/winter.npy', 'twilight_shifted_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/twilight_shifted_r.npy', 'gnuplot_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnuplot_r.npy', 'prism': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/prism.npy', 'viridis': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/viridis.npy', 'pubugn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pubugn_r.npy', 'oxy': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/oxy.npy', 'haline': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/haline.npy', 'ylorbr': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylorbr.npy', 'winter_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/winter_r.npy', 'solar': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/solar.npy', 'gist_heat': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_heat.npy', 'rdylbu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdylbu.npy', 'dark2': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/dark2.npy', 'dark2_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/dark2_r.npy', 'terrain_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/terrain_r.npy', 'set3': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set3.npy', 'gray_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gray_r.npy', 'tab20_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20_r.npy', 'brbg_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/brbg_r.npy', 'rdylgn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdylgn.npy', 'twilight': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/twilight.npy', 'balance_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/balance_r.npy', 'summer': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/summer.npy', 'hot': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/hot.npy', 'turbid': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/turbid.npy', 'diff': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/diff.npy', 'speed': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/speed.npy', 'cmrmap': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cmrmap.npy', 'set3_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set3_r.npy', 'pastel1': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pastel1.npy', 'piyg_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/piyg_r.npy', 'deep': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/deep.npy', 'greens_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/greens_r.npy', 'inferno_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/inferno_r.npy', 'curl_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/curl_r.npy', 'pubugn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pubugn.npy', 'seismic_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/seismic_r.npy', 'cmrmap_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cmrmap_r.npy', 'hsv_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/hsv_r.npy', 'ylorrd': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylorrd.npy', 'dense': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/dense.npy', 'oxy_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/oxy_r.npy', 'bwr': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bwr.npy', 'bone': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bone.npy', 'set1_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set1_r.npy', 'pastel2': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pastel2.npy', 'reds': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/reds.npy', 'delta_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/delta_r.npy', 'gist_rainbow_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_rainbow_r.npy', 'orrd_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/orrd_r.npy', 'phase_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/phase_r.npy', 'pink': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pink.npy', 'rainbow_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rainbow_r.npy', 'set2_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set2_r.npy', 'bugn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bugn.npy', 'ocean': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ocean.npy', 'copper': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/copper.npy', 'gist_ncar': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_ncar.npy', 'cubehelix': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cubehelix.npy', 'spring_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/spring_r.npy', 'cool_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cool_r.npy', 'ocean_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ocean_r.npy', 'thermal': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/thermal.npy', 'tab10_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab10_r.npy', 'cividis': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cividis.npy', 'nipy_spectral': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/nipy_spectral.npy', 'copper_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/copper_r.npy', 'inferno': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/inferno.npy', 'amp_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/amp_r.npy', 'speed_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/speed_r.npy', 'tab10': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab10.npy', 'gist_earth': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_earth.npy', 'prism_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/prism_r.npy', 'rdylgn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdylgn_r.npy', 'twilight_shifted': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/twilight_shifted.npy', 'pubu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pubu.npy', 'prgn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/prgn_r.npy', 'gist_gray': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_gray.npy', 'gray': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gray.npy', 'pubu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pubu_r.npy', 'purd_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/purd_r.npy', 'jet': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/jet.npy', 'flag': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/flag.npy', 'ice_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ice_r.npy', 'tab20c_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20c_r.npy', 'paired_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/paired_r.npy', 'cividis_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cividis_r.npy', 'gnbu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnbu_r.npy', 'autumn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/autumn_r.npy', 'cfastie': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cfastie.npy', 'spring': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/spring.npy', 'magma_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/magma_r.npy', 'rain_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rain_r.npy', 'bugn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bugn_r.npy', 'afmhot': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/afmhot.npy', 'pastel2_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pastel2_r.npy', 'brg_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/brg_r.npy', 'puor_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/puor_r.npy', 'nipy_spectral_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/nipy_spectral_r.npy', 'gist_stern': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_stern.npy', 'phase': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/phase.npy', 'deep_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/deep_r.npy', 'tempo': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tempo.npy', 'gist_ncar_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_ncar_r.npy', 'amp': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/amp.npy', 'balance': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/balance.npy', 'spectral': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/spectral.npy', 'cubehelix_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cubehelix_r.npy', 'delta': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/delta.npy', 'rain': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rain.npy', 'diff_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/diff_r.npy', 'magma': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/magma.npy', 'greens': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/greens.npy', 'reds_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/reds_r.npy', 'gist_heat_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_heat_r.npy', 'piyg': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/piyg.npy', 'set1': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set1.npy', 'topo_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/topo_r.npy', 'bone_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bone_r.npy', 'binary_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/binary_r.npy', 'tab20c': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20c.npy', 'rdgy_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdgy_r.npy', 'wistia_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/wistia_r.npy', 'topo': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/topo.npy', 'algae_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/algae_r.npy', 'autumn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/autumn.npy', 'gist_yarg_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_yarg_r.npy', 'ylorrd_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylorrd_r.npy', 'rdbu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdbu_r.npy', 'pink_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pink_r.npy', 'paired': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/paired.npy', 'matter': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/matter.npy', 'terrain': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/terrain.npy', 'twilight_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/twilight_r.npy', 'oranges': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/oranges.npy', 'brg': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/brg.npy', 'ylgnbu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylgnbu_r.npy', 'purples': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/purples.npy', 'set2': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set2.npy', 'plasma': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/plasma.npy', 'ylorbr_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylorbr_r.npy', 'spectral_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/spectral_r.npy', 'plasma_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/plasma_r.npy', 'coolwarm': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/coolwarm.npy', 'turbo_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/turbo_r.npy', 'binary': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/binary.npy', 'schwarzwald': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/schwarzwald.npy', 'rdpu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdpu.npy', 'greys_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/greys_r.npy', 'coolwarm_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/coolwarm_r.npy', 'tarn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tarn.npy', 'algae': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/algae.npy', 'oranges_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/oranges_r.npy', 'rainbow': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rainbow.npy', 'orrd': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/orrd.npy', 'curl': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/curl.npy', 'accent': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/accent.npy', 'rplumbo': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rplumbo.npy', 'afmhot_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/afmhot_r.npy', 'turbo': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/turbo.npy', 'hsv': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/hsv.npy', 'ylgn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylgn_r.npy', 'blues': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/blues.npy', 'tab20b': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20b.npy', 'accent_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/accent_r.npy', 'ice': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ice.npy', 'gist_stern_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_stern_r.npy', 'blues_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/blues_r.npy', 'rdbu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdbu.npy', 'hot_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/hot_r.npy', 'jet_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/jet_r.npy', 'seismic': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/seismic.npy', 'summer_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/summer_r.npy', 'ylgnbu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylgnbu.npy', 'tab20b_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20b_r.npy', 'pastel1_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pastel1_r.npy', 'rdgy': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdgy.npy', 'gist_rainbow': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_rainbow.npy', 'dense_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/dense_r.npy', 'turbid_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/turbid_r.npy', 'bupu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bupu_r.npy', 'solar_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/solar_r.npy', 'gnbu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnbu.npy', 'prgn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/prgn.npy', 'greys': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/greys.npy', 'tab20': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20.npy', 'haline_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/haline_r.npy', 'gist_gray_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_gray_r.npy', 'gnuplot2_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnuplot2_r.npy', 'gnuplot2': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnuplot2.npy'}),
+ router: fastapi.routing.APIRouter = <factory>
+)
+
Colormap endpoints Factory.
+supported_colormaps
+
def url_for(
+ self,
+ request: starlette.requests.Request,
+ name: str,
+ **path_params: Any
+) -> str
+
Return full url (with prefix) for a specific endpoint.
+class FactoryExtension(
+
+)
+
Factory Extension.
+def register(
+ self,
+ factory: 'BaseTilerFactory'
+)
+
Register extension to the factory.
+class MultiBandTilerFactory(
+ reader: Type[rio_tiler.io.base.MultiBandReader] = <class 'rio_tiler.io.rasterio.Reader'>,
+ router: fastapi.routing.APIRouter = <factory>,
+ path_dependency: Callable[..., Any] = <function DatasetPathParams at 0x7fa02174f920>,
+ layer_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.BandsExprParams'>,
+ dataset_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DatasetParams'>,
+ process_dependency: Callable[..., Optional[titiler.core.algorithm.base.BaseAlgorithm]] = <function Algorithms.dependency.<locals>.post_process at 0x7fa017ea3600>,
+ rescale_dependency: Callable[..., Optional[List[Tuple[float, ...]]]] = <function RescalingParams at 0x7fa018242980>,
+ color_formula_dependency: Callable[..., Optional[str]] = <function ColorFormulaParams at 0x7fa018265580>,
+ colormap_dependency: Callable[..., Union[Dict[int, Tuple[int, int, int, int]], Sequence[Tuple[Tuple[Union[float, int], Union[float, int]], Tuple[int, int, int, int]]], NoneType]] = <function create_colormap_dependency.<locals>.deps at 0x7fa02233f560>,
+ render_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.ImageRenderingParams'>,
+ reader_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DefaultDependency'>,
+ environment_dependency: Callable[..., Dict] = <function BaseTilerFactory.<lambda> at 0x7fa017f18400>,
+ supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WGS1984Quad.json'), 'WebMercatorQuad': <TileMatrixSet title='Google Maps Compatible for the World' id='WebMercatorQuad' crs='http://www.opengis.net/def/crs/EPSG/0/3857>, 'WorldCRS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
+ default_tms: Optional[str] = None,
+ router_prefix: str = '',
+ optional_headers: List[titiler.core.resources.enums.OptionalHeader] = <factory>,
+ route_dependencies: List[Tuple[List[titiler.core.routing.EndpointScope], List[fastapi.params.Depends]]] = <factory>,
+ extensions: List[titiler.core.factory.FactoryExtension] = <factory>,
+ templates: starlette.templating.Jinja2Templates = <starlette.templating.Jinja2Templates object at 0x7fa017fd2b50>,
+ stats_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.StatisticsParams'>,
+ histogram_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.HistogramParams'>,
+ img_preview_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.PreviewParams'>,
+ img_part_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.PartFeatureParams'>,
+ tile_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.TileParams'>,
+ add_preview: bool = True,
+ add_part: bool = True,
+ add_viewer: bool = True,
+ bands_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.BandsParams'>
+)
+
Custom Tiler Factory for MultiBandReader classes.
+Note:
+ To be able to use the rio_tiler.io.MultiBandReader we need to be able to pass a bands
+ argument to most of its methods. By using the BandsExprParams
for the layer_dependency
, the
+ .tile(), .point(), .preview() and the .part() methods will receive bands or expression arguments.
The rio_tiler.io.MultiBandReader `.info()` and `.metadata()` have `bands` as
+a requirement arguments (https://github.com/cogeotiff/rio-tiler/blob/main/rio_tiler/io/base.py#L775).
+This means we have to update the /info and /metadata endpoints in order to add the `bands` dependency.
+
+For implementation example see https://github.com/developmentseed/titiler-pds
+
add_part
+
add_preview
+
add_viewer
+
bands_dependency
+
dataset_dependency
+
default_tms
+
histogram_dependency
+
img_part_dependency
+
img_preview_dependency
+
layer_dependency
+
reader
+
reader_dependency
+
render_dependency
+
router_prefix
+
stats_dependency
+
supported_tms
+
templates
+
tile_dependency
+
def add_route_dependencies(
+ self,
+ *,
+ scopes: List[titiler.core.routing.EndpointScope],
+ dependencies=typing.List[fastapi.params.Depends]
+)
+
Add dependencies to routes.
+Allows a developer to add dependencies to a route after the route has been defined.
+def bounds(
+ self
+)
+
Register /bounds endpoint.
+def color_formula_dependency(
+ color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[str]
+
ColorFormula Parameter.
+def colormap_dependency(
+ colormap_name: Annotated[Literal['flag_r', 'gist_earth_r', 'cool', 'rdpu_r', 'matter_r', 'tempo_r', 'brbg', 'bwr_r', 'wistia', 'gist_yarg', 'ylgn', 'tarn_r', 'puor', 'purd', 'bupu', 'viridis_r', 'rdylbu_r', 'thermal_r', 'purples_r', 'gnuplot', 'winter', 'twilight_shifted_r', 'gnuplot_r', 'prism', 'viridis', 'pubugn_r', 'oxy', 'haline', 'ylorbr', 'winter_r', 'solar', 'gist_heat', 'rdylbu', 'dark2', 'dark2_r', 'terrain_r', 'set3', 'gray_r', 'tab20_r', 'brbg_r', 'rdylgn', 'twilight', 'balance_r', 'summer', 'hot', 'turbid', 'diff', 'speed', 'cmrmap', 'set3_r', 'pastel1', 'piyg_r', 'deep', 'greens_r', 'inferno_r', 'curl_r', 'pubugn', 'seismic_r', 'cmrmap_r', 'hsv_r', 'ylorrd', 'dense', 'oxy_r', 'bwr', 'bone', 'set1_r', 'pastel2', 'reds', 'delta_r', 'gist_rainbow_r', 'orrd_r', 'phase_r', 'pink', 'rainbow_r', 'set2_r', 'bugn', 'ocean', 'copper', 'gist_ncar', 'cubehelix', 'spring_r', 'cool_r', 'ocean_r', 'thermal', 'tab10_r', 'cividis', 'nipy_spectral', 'copper_r', 'inferno', 'amp_r', 'speed_r', 'tab10', 'gist_earth', 'prism_r', 'rdylgn_r', 'twilight_shifted', 'pubu', 'prgn_r', 'gist_gray', 'gray', 'pubu_r', 'purd_r', 'jet', 'flag', 'ice_r', 'tab20c_r', 'paired_r', 'cividis_r', 'gnbu_r', 'autumn_r', 'cfastie', 'spring', 'magma_r', 'rain_r', 'bugn_r', 'afmhot', 'pastel2_r', 'brg_r', 'puor_r', 'nipy_spectral_r', 'gist_stern', 'phase', 'deep_r', 'tempo', 'gist_ncar_r', 'amp', 'balance', 'spectral', 'cubehelix_r', 'delta', 'rain', 'diff_r', 'magma', 'greens', 'reds_r', 'gist_heat_r', 'piyg', 'set1', 'topo_r', 'bone_r', 'binary_r', 'tab20c', 'rdgy_r', 'wistia_r', 'topo', 'algae_r', 'autumn', 'gist_yarg_r', 'ylorrd_r', 'rdbu_r', 'pink_r', 'paired', 'matter', 'terrain', 'twilight_r', 'oranges', 'brg', 'ylgnbu_r', 'purples', 'set2', 'plasma', 'ylorbr_r', 'spectral_r', 'plasma_r', 'coolwarm', 'turbo_r', 'binary', 'schwarzwald', 'rdpu', 'greys_r', 'coolwarm_r', 'tarn', 'algae', 'oranges_r', 'rainbow', 'orrd', 'curl', 'accent', 'rplumbo', 'afmhot_r', 'turbo', 'hsv', 'ylgn_r', 'blues', 'tab20b', 'accent_r', 'ice', 'gist_stern_r', 'blues_r', 'rdbu', 'hot_r', 'jet_r', 'seismic', 'summer_r', 'ylgnbu', 'tab20b_r', 'pastel1_r', 'rdgy', 'gist_rainbow', 'dense_r', 'turbid_r', 'bupu_r', 'solar_r', 'gnbu', 'prgn', 'greys', 'tab20', 'haline_r', 'gist_gray_r', 'gnuplot2_r', 'gnuplot2'], Query(PydanticUndefined)] = None,
+ colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
def environment_dependency(
+
+)
+
def info(
+ self
+)
+
Register /info endpoint.
+def map_viewer(
+ self
+)
+
Register /map endpoint.
+def part(
+ self
+)
+
Register /bbox and /feature
endpoints.
def path_dependency(
+ url: typing.Annotated[str, Query(PydanticUndefined)]
+) -> str
+
Create dataset path from args
+def point(
+ self
+)
+
Register /point endpoints.
+def preview(
+ self
+)
+
Register /preview endpoint.
+def process_dependency(
+ algorithm: Annotated[Literal['hillshade', 'contours', 'normalizedIndex', 'terrarium', 'terrainrgb'], Query(PydanticUndefined)] = None,
+ algorithm_params: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[titiler.core.algorithm.base.BaseAlgorithm]
+
Data Post-Processing options.
+def register_routes(
+ self
+)
+
This Method register routes to the router.
+Because we wrap the endpoints in a class we cannot define the routes as +methods (because of the self argument). The HACK is to define routes inside +the class method and register them after the class initialization.
+def rescale_dependency(
+ rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
+) -> Optional[List[Tuple[float, ...]]]
+
Min/Max data Rescaling
+def statistics(
+ self
+)
+
add statistics endpoints.
+def tile(
+ self
+)
+
Register /tiles endpoint.
+def tilejson(
+ self
+)
+
Register /tilejson.json endpoint.
+def url_for(
+ self,
+ request: starlette.requests.Request,
+ name: str,
+ **path_params: Any
+) -> str
+
Return full url (with prefix) for a specific endpoint.
+def wmts(
+ self
+)
+
Register /wmts endpoint.
+class MultiBaseTilerFactory(
+ reader: Type[rio_tiler.io.base.MultiBaseReader] = <class 'rio_tiler.io.rasterio.Reader'>,
+ router: fastapi.routing.APIRouter = <factory>,
+ path_dependency: Callable[..., Any] = <function DatasetPathParams at 0x7fa02174f920>,
+ layer_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.AssetsBidxExprParams'>,
+ dataset_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DatasetParams'>,
+ process_dependency: Callable[..., Optional[titiler.core.algorithm.base.BaseAlgorithm]] = <function Algorithms.dependency.<locals>.post_process at 0x7fa017ea3600>,
+ rescale_dependency: Callable[..., Optional[List[Tuple[float, ...]]]] = <function RescalingParams at 0x7fa018242980>,
+ color_formula_dependency: Callable[..., Optional[str]] = <function ColorFormulaParams at 0x7fa018265580>,
+ colormap_dependency: Callable[..., Union[Dict[int, Tuple[int, int, int, int]], Sequence[Tuple[Tuple[Union[float, int], Union[float, int]], Tuple[int, int, int, int]]], NoneType]] = <function create_colormap_dependency.<locals>.deps at 0x7fa02233f560>,
+ render_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.ImageRenderingParams'>,
+ reader_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DefaultDependency'>,
+ environment_dependency: Callable[..., Dict] = <function BaseTilerFactory.<lambda> at 0x7fa017f18400>,
+ supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WGS1984Quad.json'), 'WebMercatorQuad': <TileMatrixSet title='Google Maps Compatible for the World' id='WebMercatorQuad' crs='http://www.opengis.net/def/crs/EPSG/0/3857>, 'WorldCRS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
+ default_tms: Optional[str] = None,
+ router_prefix: str = '',
+ optional_headers: List[titiler.core.resources.enums.OptionalHeader] = <factory>,
+ route_dependencies: List[Tuple[List[titiler.core.routing.EndpointScope], List[fastapi.params.Depends]]] = <factory>,
+ extensions: List[titiler.core.factory.FactoryExtension] = <factory>,
+ templates: starlette.templating.Jinja2Templates = <starlette.templating.Jinja2Templates object at 0x7fa017fd2b50>,
+ stats_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.StatisticsParams'>,
+ histogram_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.HistogramParams'>,
+ img_preview_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.PreviewParams'>,
+ img_part_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.PartFeatureParams'>,
+ tile_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.TileParams'>,
+ add_preview: bool = True,
+ add_part: bool = True,
+ add_viewer: bool = True,
+ assets_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.AssetsParams'>
+)
+
Custom Tiler Factory for MultiBaseReader classes.
+Note:
+ To be able to use the rio_tiler.io.MultiBaseReader we need to be able to pass a assets
+ argument to most of its methods. By using the AssetsBidxExprParams
for the layer_dependency
, the
+ .tile(), .point(), .preview() and the .part() methods will receive assets, expression or indexes arguments.
The rio_tiler.io.MultiBaseReader `.info()` and `.metadata()` have `assets` as
+a requirement arguments (https://github.com/cogeotiff/rio-tiler/blob/main/rio_tiler/io/base.py#L365).
+This means we have to update the /info and /metadata endpoints in order to add the `assets` dependency.
+
add_part
+
add_preview
+
add_viewer
+
assets_dependency
+
dataset_dependency
+
default_tms
+
histogram_dependency
+
img_part_dependency
+
img_preview_dependency
+
layer_dependency
+
reader
+
reader_dependency
+
render_dependency
+
router_prefix
+
stats_dependency
+
supported_tms
+
templates
+
tile_dependency
+
def add_route_dependencies(
+ self,
+ *,
+ scopes: List[titiler.core.routing.EndpointScope],
+ dependencies=typing.List[fastapi.params.Depends]
+)
+
Add dependencies to routes.
+Allows a developer to add dependencies to a route after the route has been defined.
+def bounds(
+ self
+)
+
Register /bounds endpoint.
+def color_formula_dependency(
+ color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[str]
+
ColorFormula Parameter.
+def colormap_dependency(
+ colormap_name: Annotated[Literal['flag_r', 'gist_earth_r', 'cool', 'rdpu_r', 'matter_r', 'tempo_r', 'brbg', 'bwr_r', 'wistia', 'gist_yarg', 'ylgn', 'tarn_r', 'puor', 'purd', 'bupu', 'viridis_r', 'rdylbu_r', 'thermal_r', 'purples_r', 'gnuplot', 'winter', 'twilight_shifted_r', 'gnuplot_r', 'prism', 'viridis', 'pubugn_r', 'oxy', 'haline', 'ylorbr', 'winter_r', 'solar', 'gist_heat', 'rdylbu', 'dark2', 'dark2_r', 'terrain_r', 'set3', 'gray_r', 'tab20_r', 'brbg_r', 'rdylgn', 'twilight', 'balance_r', 'summer', 'hot', 'turbid', 'diff', 'speed', 'cmrmap', 'set3_r', 'pastel1', 'piyg_r', 'deep', 'greens_r', 'inferno_r', 'curl_r', 'pubugn', 'seismic_r', 'cmrmap_r', 'hsv_r', 'ylorrd', 'dense', 'oxy_r', 'bwr', 'bone', 'set1_r', 'pastel2', 'reds', 'delta_r', 'gist_rainbow_r', 'orrd_r', 'phase_r', 'pink', 'rainbow_r', 'set2_r', 'bugn', 'ocean', 'copper', 'gist_ncar', 'cubehelix', 'spring_r', 'cool_r', 'ocean_r', 'thermal', 'tab10_r', 'cividis', 'nipy_spectral', 'copper_r', 'inferno', 'amp_r', 'speed_r', 'tab10', 'gist_earth', 'prism_r', 'rdylgn_r', 'twilight_shifted', 'pubu', 'prgn_r', 'gist_gray', 'gray', 'pubu_r', 'purd_r', 'jet', 'flag', 'ice_r', 'tab20c_r', 'paired_r', 'cividis_r', 'gnbu_r', 'autumn_r', 'cfastie', 'spring', 'magma_r', 'rain_r', 'bugn_r', 'afmhot', 'pastel2_r', 'brg_r', 'puor_r', 'nipy_spectral_r', 'gist_stern', 'phase', 'deep_r', 'tempo', 'gist_ncar_r', 'amp', 'balance', 'spectral', 'cubehelix_r', 'delta', 'rain', 'diff_r', 'magma', 'greens', 'reds_r', 'gist_heat_r', 'piyg', 'set1', 'topo_r', 'bone_r', 'binary_r', 'tab20c', 'rdgy_r', 'wistia_r', 'topo', 'algae_r', 'autumn', 'gist_yarg_r', 'ylorrd_r', 'rdbu_r', 'pink_r', 'paired', 'matter', 'terrain', 'twilight_r', 'oranges', 'brg', 'ylgnbu_r', 'purples', 'set2', 'plasma', 'ylorbr_r', 'spectral_r', 'plasma_r', 'coolwarm', 'turbo_r', 'binary', 'schwarzwald', 'rdpu', 'greys_r', 'coolwarm_r', 'tarn', 'algae', 'oranges_r', 'rainbow', 'orrd', 'curl', 'accent', 'rplumbo', 'afmhot_r', 'turbo', 'hsv', 'ylgn_r', 'blues', 'tab20b', 'accent_r', 'ice', 'gist_stern_r', 'blues_r', 'rdbu', 'hot_r', 'jet_r', 'seismic', 'summer_r', 'ylgnbu', 'tab20b_r', 'pastel1_r', 'rdgy', 'gist_rainbow', 'dense_r', 'turbid_r', 'bupu_r', 'solar_r', 'gnbu', 'prgn', 'greys', 'tab20', 'haline_r', 'gist_gray_r', 'gnuplot2_r', 'gnuplot2'], Query(PydanticUndefined)] = None,
+ colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
def environment_dependency(
+
+)
+
def info(
+ self
+)
+
Register /info endpoint.
+def map_viewer(
+ self
+)
+
Register /map endpoint.
+def part(
+ self
+)
+
Register /bbox and /feature
endpoints.
def path_dependency(
+ url: typing.Annotated[str, Query(PydanticUndefined)]
+) -> str
+
Create dataset path from args
+def point(
+ self
+)
+
Register /point endpoints.
+def preview(
+ self
+)
+
Register /preview endpoint.
+def process_dependency(
+ algorithm: Annotated[Literal['hillshade', 'contours', 'normalizedIndex', 'terrarium', 'terrainrgb'], Query(PydanticUndefined)] = None,
+ algorithm_params: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[titiler.core.algorithm.base.BaseAlgorithm]
+
Data Post-Processing options.
+def register_routes(
+ self
+)
+
This Method register routes to the router.
+Because we wrap the endpoints in a class we cannot define the routes as +methods (because of the self argument). The HACK is to define routes inside +the class method and register them after the class initialization.
+def rescale_dependency(
+ rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
+) -> Optional[List[Tuple[float, ...]]]
+
Min/Max data Rescaling
+def statistics(
+ self
+)
+
Register /statistics endpoint.
+def tile(
+ self
+)
+
Register /tiles endpoint.
+def tilejson(
+ self
+)
+
Register /tilejson.json endpoint.
+def url_for(
+ self,
+ request: starlette.requests.Request,
+ name: str,
+ **path_params: Any
+) -> str
+
Return full url (with prefix) for a specific endpoint.
+def wmts(
+ self
+)
+
Register /wmts endpoint.
+class TMSFactory(
+ supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WGS1984Quad.json'), 'WebMercatorQuad': <TileMatrixSet title='Google Maps Compatible for the World' id='WebMercatorQuad' crs='http://www.opengis.net/def/crs/EPSG/0/3857>, 'WorldCRS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
+ router: fastapi.routing.APIRouter = <factory>,
+ router_prefix: str = ''
+)
+
TileMatrixSet endpoints Factory.
+router_prefix
+
supported_tms
+
def register_routes(
+ self
+)
+
Register TMS endpoint routes.
+def url_for(
+ self,
+ request: starlette.requests.Request,
+ name: str,
+ **path_params: Any
+) -> str
+
Return full url (with prefix) for a specific endpoint.
+class TilerFactory(
+ reader: Type[rio_tiler.io.base.BaseReader] = <class 'rio_tiler.io.rasterio.Reader'>,
+ router: fastapi.routing.APIRouter = <factory>,
+ path_dependency: Callable[..., Any] = <function DatasetPathParams at 0x7fa02174f920>,
+ layer_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.BidxExprParams'>,
+ dataset_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DatasetParams'>,
+ process_dependency: Callable[..., Optional[titiler.core.algorithm.base.BaseAlgorithm]] = <function Algorithms.dependency.<locals>.post_process at 0x7fa017ea3600>,
+ rescale_dependency: Callable[..., Optional[List[Tuple[float, ...]]]] = <function RescalingParams at 0x7fa018242980>,
+ color_formula_dependency: Callable[..., Optional[str]] = <function ColorFormulaParams at 0x7fa018265580>,
+ colormap_dependency: Callable[..., Union[Dict[int, Tuple[int, int, int, int]], Sequence[Tuple[Tuple[Union[float, int], Union[float, int]], Tuple[int, int, int, int]]], NoneType]] = <function create_colormap_dependency.<locals>.deps at 0x7fa02233f560>,
+ render_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.ImageRenderingParams'>,
+ reader_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DefaultDependency'>,
+ environment_dependency: Callable[..., Dict] = <function BaseTilerFactory.<lambda> at 0x7fa017f18400>,
+ supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WGS1984Quad.json'), 'WebMercatorQuad': <TileMatrixSet title='Google Maps Compatible for the World' id='WebMercatorQuad' crs='http://www.opengis.net/def/crs/EPSG/0/3857>, 'WorldCRS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
+ default_tms: Optional[str] = None,
+ router_prefix: str = '',
+ optional_headers: List[titiler.core.resources.enums.OptionalHeader] = <factory>,
+ route_dependencies: List[Tuple[List[titiler.core.routing.EndpointScope], List[fastapi.params.Depends]]] = <factory>,
+ extensions: List[titiler.core.factory.FactoryExtension] = <factory>,
+ templates: starlette.templating.Jinja2Templates = <starlette.templating.Jinja2Templates object at 0x7fa017fd2b50>,
+ stats_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.StatisticsParams'>,
+ histogram_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.HistogramParams'>,
+ img_preview_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.PreviewParams'>,
+ img_part_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.PartFeatureParams'>,
+ tile_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.TileParams'>,
+ add_preview: bool = True,
+ add_part: bool = True,
+ add_viewer: bool = True
+)
+
Tiler Factory.
+Name | +Type | +Description | +Default | +
---|---|---|---|
reader | +rio_tiler.io.base.BaseReader | +A rio-tiler reader. Defaults to rio_tiler.io.Reader . |
+rio_tiler.io.Reader |
+
stats_dependency | +titiler.core.dependencies.DefaultDependency | +Endpoint dependency defining options for rio-tiler's statistics method. | +None | +
histogram_dependency | +titiler.core.dependencies.DefaultDependency | +Endpoint dependency defining options for numpy's histogram method. | +None | +
img_preview_dependency | +titiler.core.dependencies.DefaultDependency | +Endpoint dependency defining options for rio-tiler's preview method. | +None | +
img_part_dependency | +titiler.core.dependencies.DefaultDependency | +Endpoint dependency defining options for rio-tiler's part/feature methods. | +None | +
add_preview | +bool | +add /preview endpoints. Defaults to True. |
+True | +
add_part | +bool | +add /bbox and /feature endpoints. Defaults to True. |
+True | +
add_viewer | +bool | +add /map endpoints. Defaults to True. |
+True | +
add_part
+
add_preview
+
add_viewer
+
dataset_dependency
+
default_tms
+
histogram_dependency
+
img_part_dependency
+
img_preview_dependency
+
layer_dependency
+
reader
+
reader_dependency
+
render_dependency
+
router_prefix
+
stats_dependency
+
supported_tms
+
templates
+
tile_dependency
+
def add_route_dependencies(
+ self,
+ *,
+ scopes: List[titiler.core.routing.EndpointScope],
+ dependencies=typing.List[fastapi.params.Depends]
+)
+
Add dependencies to routes.
+Allows a developer to add dependencies to a route after the route has been defined.
+def bounds(
+ self
+)
+
Register /bounds endpoint.
+def color_formula_dependency(
+ color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[str]
+
ColorFormula Parameter.
+def colormap_dependency(
+ colormap_name: Annotated[Literal['flag_r', 'gist_earth_r', 'cool', 'rdpu_r', 'matter_r', 'tempo_r', 'brbg', 'bwr_r', 'wistia', 'gist_yarg', 'ylgn', 'tarn_r', 'puor', 'purd', 'bupu', 'viridis_r', 'rdylbu_r', 'thermal_r', 'purples_r', 'gnuplot', 'winter', 'twilight_shifted_r', 'gnuplot_r', 'prism', 'viridis', 'pubugn_r', 'oxy', 'haline', 'ylorbr', 'winter_r', 'solar', 'gist_heat', 'rdylbu', 'dark2', 'dark2_r', 'terrain_r', 'set3', 'gray_r', 'tab20_r', 'brbg_r', 'rdylgn', 'twilight', 'balance_r', 'summer', 'hot', 'turbid', 'diff', 'speed', 'cmrmap', 'set3_r', 'pastel1', 'piyg_r', 'deep', 'greens_r', 'inferno_r', 'curl_r', 'pubugn', 'seismic_r', 'cmrmap_r', 'hsv_r', 'ylorrd', 'dense', 'oxy_r', 'bwr', 'bone', 'set1_r', 'pastel2', 'reds', 'delta_r', 'gist_rainbow_r', 'orrd_r', 'phase_r', 'pink', 'rainbow_r', 'set2_r', 'bugn', 'ocean', 'copper', 'gist_ncar', 'cubehelix', 'spring_r', 'cool_r', 'ocean_r', 'thermal', 'tab10_r', 'cividis', 'nipy_spectral', 'copper_r', 'inferno', 'amp_r', 'speed_r', 'tab10', 'gist_earth', 'prism_r', 'rdylgn_r', 'twilight_shifted', 'pubu', 'prgn_r', 'gist_gray', 'gray', 'pubu_r', 'purd_r', 'jet', 'flag', 'ice_r', 'tab20c_r', 'paired_r', 'cividis_r', 'gnbu_r', 'autumn_r', 'cfastie', 'spring', 'magma_r', 'rain_r', 'bugn_r', 'afmhot', 'pastel2_r', 'brg_r', 'puor_r', 'nipy_spectral_r', 'gist_stern', 'phase', 'deep_r', 'tempo', 'gist_ncar_r', 'amp', 'balance', 'spectral', 'cubehelix_r', 'delta', 'rain', 'diff_r', 'magma', 'greens', 'reds_r', 'gist_heat_r', 'piyg', 'set1', 'topo_r', 'bone_r', 'binary_r', 'tab20c', 'rdgy_r', 'wistia_r', 'topo', 'algae_r', 'autumn', 'gist_yarg_r', 'ylorrd_r', 'rdbu_r', 'pink_r', 'paired', 'matter', 'terrain', 'twilight_r', 'oranges', 'brg', 'ylgnbu_r', 'purples', 'set2', 'plasma', 'ylorbr_r', 'spectral_r', 'plasma_r', 'coolwarm', 'turbo_r', 'binary', 'schwarzwald', 'rdpu', 'greys_r', 'coolwarm_r', 'tarn', 'algae', 'oranges_r', 'rainbow', 'orrd', 'curl', 'accent', 'rplumbo', 'afmhot_r', 'turbo', 'hsv', 'ylgn_r', 'blues', 'tab20b', 'accent_r', 'ice', 'gist_stern_r', 'blues_r', 'rdbu', 'hot_r', 'jet_r', 'seismic', 'summer_r', 'ylgnbu', 'tab20b_r', 'pastel1_r', 'rdgy', 'gist_rainbow', 'dense_r', 'turbid_r', 'bupu_r', 'solar_r', 'gnbu', 'prgn', 'greys', 'tab20', 'haline_r', 'gist_gray_r', 'gnuplot2_r', 'gnuplot2'], Query(PydanticUndefined)] = None,
+ colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
def environment_dependency(
+
+)
+
def info(
+ self
+)
+
Register /info endpoint.
+def map_viewer(
+ self
+)
+
Register /map endpoint.
+def part(
+ self
+)
+
Register /bbox and /feature
endpoints.
def path_dependency(
+ url: typing.Annotated[str, Query(PydanticUndefined)]
+) -> str
+
Create dataset path from args
+def point(
+ self
+)
+
Register /point endpoints.
+def preview(
+ self
+)
+
Register /preview endpoint.
+def process_dependency(
+ algorithm: Annotated[Literal['hillshade', 'contours', 'normalizedIndex', 'terrarium', 'terrainrgb'], Query(PydanticUndefined)] = None,
+ algorithm_params: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[titiler.core.algorithm.base.BaseAlgorithm]
+
Data Post-Processing options.
+def register_routes(
+ self
+)
+
This Method register routes to the router.
+Because we wrap the endpoints in a class we cannot define the routes as +methods (because of the self argument). The HACK is to define routes inside +the class method and register them after the class initialization.
+def rescale_dependency(
+ rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
+) -> Optional[List[Tuple[float, ...]]]
+
Min/Max data Rescaling
+def statistics(
+ self
+)
+
add statistics endpoints.
+def tile(
+ self
+)
+
Register /tiles endpoint.
+def tilejson(
+ self
+)
+
Register /tilejson.json endpoint.
+def url_for(
+ self,
+ request: starlette.requests.Request,
+ name: str,
+ **path_params: Any
+) -> str
+
Return full url (with prefix) for a specific endpoint.
+def wmts(
+ self
+)
+
Register /wmts endpoint.
+ + + + + + + + + + + + + + + + + + +Titiler middlewares.
+class CacheControlMiddleware(
+ app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[NoneType]]], Awaitable[NoneType]],
+ cachecontrol: Optional[str] = None,
+ cachecontrol_max_http_code: Optional[int] = 500,
+ exclude_path: Optional[Set[str]] = None
+)
+
MiddleWare to add CacheControl in response headers.
+class LoggerMiddleware(
+ app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[NoneType]]], Awaitable[NoneType]],
+ querystrings: bool = False,
+ headers: bool = False
+)
+
MiddleWare to add logging.
+class LowerCaseQueryStringMiddleware(
+ app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[NoneType]]], Awaitable[NoneType]]
+)
+
Middleware to make URL parameters case-insensitive.
+taken from: tiangolo/fastapi#826
+class TotalTimeMiddleware(
+ app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[NoneType]]], Awaitable[NoneType]]
+)
+
MiddleWare to add Total process time in response headers.
+ + + + + + + + + + + + + + + + + + +Titiler.core Enums.
+class ImageDriver(
+ *args,
+ **kwds
+)
+
Supported output GDAL drivers.
+jp2
+
jpeg
+
jpg
+
name
+
npy
+
png
+
pngraw
+
tif
+
value
+
webp
+
def maketrans(
+ ...
+)
+
Return a translation table usable for str.translate().
+If there is only one argument, it must be a dictionary mapping Unicode +ordinals (integers) or characters to Unicode ordinals, strings or None. +Character keys will be then converted to ordinals. +If there are two arguments, they must be strings of equal length, and +in the resulting dictionary, each character in x will be mapped to the +character at the same position in y. If there is a third argument, it +must be a string, whose characters will be mapped to None in the result.
+def capitalize(
+ self,
+ /
+)
+
Return a capitalized version of the string.
+More specifically, make the first character have upper case and the rest lower +case.
+def casefold(
+ self,
+ /
+)
+
Return a version of the string suitable for caseless comparisons.
+def center(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a centered string of length width.
+Padding is done using the specified fill character (default is a space).
+def count(
+ ...
+)
+
S.count(sub[, start[, end]]) -> int
+Return the number of non-overlapping occurrences of substring sub in +string S[start:end]. Optional arguments start and end are +interpreted as in slice notation.
+def encode(
+ self,
+ /,
+ encoding='utf-8',
+ errors='strict'
+)
+
Encode the string using the codec registered for encoding.
+encoding + The encoding in which to encode the string. +errors + The error handling scheme to use for encoding errors. + The default is 'strict' meaning that encoding errors raise a + UnicodeEncodeError. Other possible values are 'ignore', 'replace' and + 'xmlcharrefreplace' as well as any other name registered with + codecs.register_error that can handle UnicodeEncodeErrors.
+def endswith(
+ ...
+)
+
S.endswith(suffix[, start[, end]]) -> bool
+Return True if S ends with the specified suffix, False otherwise. +With optional start, test S beginning at that position. +With optional end, stop comparing S at that position. +suffix can also be a tuple of strings to try.
+def expandtabs(
+ self,
+ /,
+ tabsize=8
+)
+
Return a copy where all tab characters are expanded using spaces.
+If tabsize is not given, a tab size of 8 characters is assumed.
+def find(
+ ...
+)
+
S.find(sub[, start[, end]]) -> int
+Return the lowest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Return -1 on failure.
+def format(
+ ...
+)
+
S.format(args, *kwargs) -> str
+Return a formatted version of S, using substitutions from args and kwargs. +The substitutions are identified by braces ('{' and '}').
+def format_map(
+ ...
+)
+
S.format_map(mapping) -> str
+Return a formatted version of S, using substitutions from mapping. +The substitutions are identified by braces ('{' and '}').
+def index(
+ ...
+)
+
S.index(sub[, start[, end]]) -> int
+Return the lowest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Raises ValueError when the substring is not found.
+def isalnum(
+ self,
+ /
+)
+
Return True if the string is an alpha-numeric string, False otherwise.
+A string is alpha-numeric if all characters in the string are alpha-numeric and +there is at least one character in the string.
+def isalpha(
+ self,
+ /
+)
+
Return True if the string is an alphabetic string, False otherwise.
+A string is alphabetic if all characters in the string are alphabetic and there +is at least one character in the string.
+def isascii(
+ self,
+ /
+)
+
Return True if all characters in the string are ASCII, False otherwise.
+ASCII characters have code points in the range U+0000-U+007F. +Empty string is ASCII too.
+def isdecimal(
+ self,
+ /
+)
+
Return True if the string is a decimal string, False otherwise.
+A string is a decimal string if all characters in the string are decimal and +there is at least one character in the string.
+def isdigit(
+ self,
+ /
+)
+
Return True if the string is a digit string, False otherwise.
+A string is a digit string if all characters in the string are digits and there +is at least one character in the string.
+def isidentifier(
+ self,
+ /
+)
+
Return True if the string is a valid Python identifier, False otherwise.
+Call keyword.iskeyword(s) to test whether string s is a reserved identifier, +such as "def" or "class".
+def islower(
+ self,
+ /
+)
+
Return True if the string is a lowercase string, False otherwise.
+A string is lowercase if all cased characters in the string are lowercase and +there is at least one cased character in the string.
+def isnumeric(
+ self,
+ /
+)
+
Return True if the string is a numeric string, False otherwise.
+A string is numeric if all characters in the string are numeric and there is at +least one character in the string.
+def isprintable(
+ self,
+ /
+)
+
Return True if the string is printable, False otherwise.
+A string is printable if all of its characters are considered printable in +repr() or if it is empty.
+def isspace(
+ self,
+ /
+)
+
Return True if the string is a whitespace string, False otherwise.
+A string is whitespace if all characters in the string are whitespace and there +is at least one character in the string.
+def istitle(
+ self,
+ /
+)
+
Return True if the string is a title-cased string, False otherwise.
+In a title-cased string, upper- and title-case characters may only +follow uncased characters and lowercase characters only cased ones.
+def isupper(
+ self,
+ /
+)
+
Return True if the string is an uppercase string, False otherwise.
+A string is uppercase if all cased characters in the string are uppercase and +there is at least one cased character in the string.
+def join(
+ self,
+ iterable,
+ /
+)
+
Concatenate any number of strings.
+The string whose method is called is inserted in between each given string. +The result is returned as a new string.
+Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
+def ljust(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a left-justified string of length width.
+Padding is done using the specified fill character (default is a space).
+def lower(
+ self,
+ /
+)
+
Return a copy of the string converted to lowercase.
+def lstrip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with leading whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def partition(
+ self,
+ sep,
+ /
+)
+
Partition the string into three parts using the given separator.
+This will search for the separator in the string. If the separator is found, +returns a 3-tuple containing the part before the separator, the separator +itself, and the part after it.
+If the separator is not found, returns a 3-tuple containing the original string +and two empty strings.
+def removeprefix(
+ self,
+ prefix,
+ /
+)
+
Return a str with the given prefix string removed if present.
+If the string starts with the prefix string, return string[len(prefix):]. +Otherwise, return a copy of the original string.
+def removesuffix(
+ self,
+ suffix,
+ /
+)
+
Return a str with the given suffix string removed if present.
+If the string ends with the suffix string and that suffix is not empty, +return string[:-len(suffix)]. Otherwise, return a copy of the original +string.
+def replace(
+ self,
+ old,
+ new,
+ count=-1,
+ /
+)
+
Return a copy with all occurrences of substring old replaced by new.
+count + Maximum number of occurrences to replace. + -1 (the default value) means replace all occurrences.
+If the optional argument count is given, only the first count occurrences are +replaced.
+def rfind(
+ ...
+)
+
S.rfind(sub[, start[, end]]) -> int
+Return the highest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Return -1 on failure.
+def rindex(
+ ...
+)
+
S.rindex(sub[, start[, end]]) -> int
+Return the highest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Raises ValueError when the substring is not found.
+def rjust(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a right-justified string of length width.
+Padding is done using the specified fill character (default is a space).
+def rpartition(
+ self,
+ sep,
+ /
+)
+
Partition the string into three parts using the given separator.
+This will search for the separator in the string, starting at the end. If +the separator is found, returns a 3-tuple containing the part before the +separator, the separator itself, and the part after it.
+If the separator is not found, returns a 3-tuple containing two empty strings +and the original string.
+def rsplit(
+ self,
+ /,
+ sep=None,
+ maxsplit=-1
+)
+
Return a list of the substrings in the string, using sep as the separator string.
+sep + The separator used to split the string.
+When set to None (the default value), will split on any whitespace
+character (including \n \r \t \f and spaces) and will discard
+empty strings from the result.
+
maxsplit + Maximum number of splits. + -1 (the default value) means no limit.
+Splitting starts at the end of the string and works to the front.
+def rstrip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with trailing whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def split(
+ self,
+ /,
+ sep=None,
+ maxsplit=-1
+)
+
Return a list of the substrings in the string, using sep as the separator string.
+sep + The separator used to split the string.
+When set to None (the default value), will split on any whitespace
+character (including \n \r \t \f and spaces) and will discard
+empty strings from the result.
+
maxsplit + Maximum number of splits. + -1 (the default value) means no limit.
+Splitting starts at the front of the string and works to the end.
+Note, str.split() is mainly useful for data that has been intentionally +delimited. With natural text that includes punctuation, consider using +the regular expression module.
+def splitlines(
+ self,
+ /,
+ keepends=False
+)
+
Return a list of the lines in the string, breaking at line boundaries.
+Line breaks are not included in the resulting list unless keepends is given and +true.
+def startswith(
+ ...
+)
+
S.startswith(prefix[, start[, end]]) -> bool
+Return True if S starts with the specified prefix, False otherwise. +With optional start, test S beginning at that position. +With optional end, stop comparing S at that position. +prefix can also be a tuple of strings to try.
+def strip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with leading and trailing whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def swapcase(
+ self,
+ /
+)
+
Convert uppercase characters to lowercase and lowercase characters to uppercase.
+def title(
+ self,
+ /
+)
+
Return a version of the string where each word is titlecased.
+More specifically, words start with uppercased characters and all remaining +cased characters have lower case.
+def translate(
+ self,
+ table,
+ /
+)
+
Replace each character in the string using the given translation table.
+table + Translation table, which must be a mapping of Unicode ordinals to + Unicode ordinals, strings, or None.
+The table must implement lookup/indexing via getitem, for instance a +dictionary or list. If this operation raises LookupError, the character is +left untouched. Characters mapped to None are deleted.
+def upper(
+ self,
+ /
+)
+
Return a copy of the string converted to uppercase.
+def zfill(
+ self,
+ width,
+ /
+)
+
Pad a numeric string with zeros on the left, to fill a field of the given width.
+The string is never truncated.
+class ImageType(
+ *args,
+ **kwds
+)
+
Available Output image type.
+jp2
+
jpeg
+
jpg
+
name
+
npy
+
png
+
pngraw
+
tif
+
value
+
webp
+
def maketrans(
+ ...
+)
+
Return a translation table usable for str.translate().
+If there is only one argument, it must be a dictionary mapping Unicode +ordinals (integers) or characters to Unicode ordinals, strings or None. +Character keys will be then converted to ordinals. +If there are two arguments, they must be strings of equal length, and +in the resulting dictionary, each character in x will be mapped to the +character at the same position in y. If there is a third argument, it +must be a string, whose characters will be mapped to None in the result.
+def capitalize(
+ self,
+ /
+)
+
Return a capitalized version of the string.
+More specifically, make the first character have upper case and the rest lower +case.
+def casefold(
+ self,
+ /
+)
+
Return a version of the string suitable for caseless comparisons.
+def center(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a centered string of length width.
+Padding is done using the specified fill character (default is a space).
+def count(
+ ...
+)
+
S.count(sub[, start[, end]]) -> int
+Return the number of non-overlapping occurrences of substring sub in +string S[start:end]. Optional arguments start and end are +interpreted as in slice notation.
+def encode(
+ self,
+ /,
+ encoding='utf-8',
+ errors='strict'
+)
+
Encode the string using the codec registered for encoding.
+encoding + The encoding in which to encode the string. +errors + The error handling scheme to use for encoding errors. + The default is 'strict' meaning that encoding errors raise a + UnicodeEncodeError. Other possible values are 'ignore', 'replace' and + 'xmlcharrefreplace' as well as any other name registered with + codecs.register_error that can handle UnicodeEncodeErrors.
+def endswith(
+ ...
+)
+
S.endswith(suffix[, start[, end]]) -> bool
+Return True if S ends with the specified suffix, False otherwise. +With optional start, test S beginning at that position. +With optional end, stop comparing S at that position. +suffix can also be a tuple of strings to try.
+def expandtabs(
+ self,
+ /,
+ tabsize=8
+)
+
Return a copy where all tab characters are expanded using spaces.
+If tabsize is not given, a tab size of 8 characters is assumed.
+def find(
+ ...
+)
+
S.find(sub[, start[, end]]) -> int
+Return the lowest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Return -1 on failure.
+def format(
+ ...
+)
+
S.format(args, *kwargs) -> str
+Return a formatted version of S, using substitutions from args and kwargs. +The substitutions are identified by braces ('{' and '}').
+def format_map(
+ ...
+)
+
S.format_map(mapping) -> str
+Return a formatted version of S, using substitutions from mapping. +The substitutions are identified by braces ('{' and '}').
+def index(
+ ...
+)
+
S.index(sub[, start[, end]]) -> int
+Return the lowest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Raises ValueError when the substring is not found.
+def isalnum(
+ self,
+ /
+)
+
Return True if the string is an alpha-numeric string, False otherwise.
+A string is alpha-numeric if all characters in the string are alpha-numeric and +there is at least one character in the string.
+def isalpha(
+ self,
+ /
+)
+
Return True if the string is an alphabetic string, False otherwise.
+A string is alphabetic if all characters in the string are alphabetic and there +is at least one character in the string.
+def isascii(
+ self,
+ /
+)
+
Return True if all characters in the string are ASCII, False otherwise.
+ASCII characters have code points in the range U+0000-U+007F. +Empty string is ASCII too.
+def isdecimal(
+ self,
+ /
+)
+
Return True if the string is a decimal string, False otherwise.
+A string is a decimal string if all characters in the string are decimal and +there is at least one character in the string.
+def isdigit(
+ self,
+ /
+)
+
Return True if the string is a digit string, False otherwise.
+A string is a digit string if all characters in the string are digits and there +is at least one character in the string.
+def isidentifier(
+ self,
+ /
+)
+
Return True if the string is a valid Python identifier, False otherwise.
+Call keyword.iskeyword(s) to test whether string s is a reserved identifier, +such as "def" or "class".
+def islower(
+ self,
+ /
+)
+
Return True if the string is a lowercase string, False otherwise.
+A string is lowercase if all cased characters in the string are lowercase and +there is at least one cased character in the string.
+def isnumeric(
+ self,
+ /
+)
+
Return True if the string is a numeric string, False otherwise.
+A string is numeric if all characters in the string are numeric and there is at +least one character in the string.
+def isprintable(
+ self,
+ /
+)
+
Return True if the string is printable, False otherwise.
+A string is printable if all of its characters are considered printable in +repr() or if it is empty.
+def isspace(
+ self,
+ /
+)
+
Return True if the string is a whitespace string, False otherwise.
+A string is whitespace if all characters in the string are whitespace and there +is at least one character in the string.
+def istitle(
+ self,
+ /
+)
+
Return True if the string is a title-cased string, False otherwise.
+In a title-cased string, upper- and title-case characters may only +follow uncased characters and lowercase characters only cased ones.
+def isupper(
+ self,
+ /
+)
+
Return True if the string is an uppercase string, False otherwise.
+A string is uppercase if all cased characters in the string are uppercase and +there is at least one cased character in the string.
+def join(
+ self,
+ iterable,
+ /
+)
+
Concatenate any number of strings.
+The string whose method is called is inserted in between each given string. +The result is returned as a new string.
+Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
+def ljust(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a left-justified string of length width.
+Padding is done using the specified fill character (default is a space).
+def lower(
+ self,
+ /
+)
+
Return a copy of the string converted to lowercase.
+def lstrip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with leading whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def partition(
+ self,
+ sep,
+ /
+)
+
Partition the string into three parts using the given separator.
+This will search for the separator in the string. If the separator is found, +returns a 3-tuple containing the part before the separator, the separator +itself, and the part after it.
+If the separator is not found, returns a 3-tuple containing the original string +and two empty strings.
+def removeprefix(
+ self,
+ prefix,
+ /
+)
+
Return a str with the given prefix string removed if present.
+If the string starts with the prefix string, return string[len(prefix):]. +Otherwise, return a copy of the original string.
+def removesuffix(
+ self,
+ suffix,
+ /
+)
+
Return a str with the given suffix string removed if present.
+If the string ends with the suffix string and that suffix is not empty, +return string[:-len(suffix)]. Otherwise, return a copy of the original +string.
+def replace(
+ self,
+ old,
+ new,
+ count=-1,
+ /
+)
+
Return a copy with all occurrences of substring old replaced by new.
+count + Maximum number of occurrences to replace. + -1 (the default value) means replace all occurrences.
+If the optional argument count is given, only the first count occurrences are +replaced.
+def rfind(
+ ...
+)
+
S.rfind(sub[, start[, end]]) -> int
+Return the highest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Return -1 on failure.
+def rindex(
+ ...
+)
+
S.rindex(sub[, start[, end]]) -> int
+Return the highest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Raises ValueError when the substring is not found.
+def rjust(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a right-justified string of length width.
+Padding is done using the specified fill character (default is a space).
+def rpartition(
+ self,
+ sep,
+ /
+)
+
Partition the string into three parts using the given separator.
+This will search for the separator in the string, starting at the end. If +the separator is found, returns a 3-tuple containing the part before the +separator, the separator itself, and the part after it.
+If the separator is not found, returns a 3-tuple containing two empty strings +and the original string.
+def rsplit(
+ self,
+ /,
+ sep=None,
+ maxsplit=-1
+)
+
Return a list of the substrings in the string, using sep as the separator string.
+sep + The separator used to split the string.
+When set to None (the default value), will split on any whitespace
+character (including \n \r \t \f and spaces) and will discard
+empty strings from the result.
+
maxsplit + Maximum number of splits. + -1 (the default value) means no limit.
+Splitting starts at the end of the string and works to the front.
+def rstrip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with trailing whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def split(
+ self,
+ /,
+ sep=None,
+ maxsplit=-1
+)
+
Return a list of the substrings in the string, using sep as the separator string.
+sep + The separator used to split the string.
+When set to None (the default value), will split on any whitespace
+character (including \n \r \t \f and spaces) and will discard
+empty strings from the result.
+
maxsplit + Maximum number of splits. + -1 (the default value) means no limit.
+Splitting starts at the front of the string and works to the end.
+Note, str.split() is mainly useful for data that has been intentionally +delimited. With natural text that includes punctuation, consider using +the regular expression module.
+def splitlines(
+ self,
+ /,
+ keepends=False
+)
+
Return a list of the lines in the string, breaking at line boundaries.
+Line breaks are not included in the resulting list unless keepends is given and +true.
+def startswith(
+ ...
+)
+
S.startswith(prefix[, start[, end]]) -> bool
+Return True if S starts with the specified prefix, False otherwise. +With optional start, test S beginning at that position. +With optional end, stop comparing S at that position. +prefix can also be a tuple of strings to try.
+def strip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with leading and trailing whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def swapcase(
+ self,
+ /
+)
+
Convert uppercase characters to lowercase and lowercase characters to uppercase.
+def title(
+ self,
+ /
+)
+
Return a version of the string where each word is titlecased.
+More specifically, words start with uppercased characters and all remaining +cased characters have lower case.
+def translate(
+ self,
+ table,
+ /
+)
+
Replace each character in the string using the given translation table.
+table + Translation table, which must be a mapping of Unicode ordinals to + Unicode ordinals, strings, or None.
+The table must implement lookup/indexing via getitem, for instance a +dictionary or list. If this operation raises LookupError, the character is +left untouched. Characters mapped to None are deleted.
+def upper(
+ self,
+ /
+)
+
Return a copy of the string converted to uppercase.
+def zfill(
+ self,
+ width,
+ /
+)
+
Pad a numeric string with zeros on the left, to fill a field of the given width.
+The string is never truncated.
+class MediaType(
+ *args,
+ **kwds
+)
+
Responses Media types formerly known as MIME types.
+csv
+
geojson
+
geojsonseq
+
html
+
jp2
+
jpeg
+
jpg
+
json
+
mvt
+
name
+
ndjson
+
npy
+
openapi30_json
+
openapi30_yaml
+
pbf
+
png
+
pngraw
+
schemajson
+
text
+
tif
+
value
+
webp
+
xml
+
def maketrans(
+ ...
+)
+
Return a translation table usable for str.translate().
+If there is only one argument, it must be a dictionary mapping Unicode +ordinals (integers) or characters to Unicode ordinals, strings or None. +Character keys will be then converted to ordinals. +If there are two arguments, they must be strings of equal length, and +in the resulting dictionary, each character in x will be mapped to the +character at the same position in y. If there is a third argument, it +must be a string, whose characters will be mapped to None in the result.
+def capitalize(
+ self,
+ /
+)
+
Return a capitalized version of the string.
+More specifically, make the first character have upper case and the rest lower +case.
+def casefold(
+ self,
+ /
+)
+
Return a version of the string suitable for caseless comparisons.
+def center(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a centered string of length width.
+Padding is done using the specified fill character (default is a space).
+def count(
+ ...
+)
+
S.count(sub[, start[, end]]) -> int
+Return the number of non-overlapping occurrences of substring sub in +string S[start:end]. Optional arguments start and end are +interpreted as in slice notation.
+def encode(
+ self,
+ /,
+ encoding='utf-8',
+ errors='strict'
+)
+
Encode the string using the codec registered for encoding.
+encoding + The encoding in which to encode the string. +errors + The error handling scheme to use for encoding errors. + The default is 'strict' meaning that encoding errors raise a + UnicodeEncodeError. Other possible values are 'ignore', 'replace' and + 'xmlcharrefreplace' as well as any other name registered with + codecs.register_error that can handle UnicodeEncodeErrors.
+def endswith(
+ ...
+)
+
S.endswith(suffix[, start[, end]]) -> bool
+Return True if S ends with the specified suffix, False otherwise. +With optional start, test S beginning at that position. +With optional end, stop comparing S at that position. +suffix can also be a tuple of strings to try.
+def expandtabs(
+ self,
+ /,
+ tabsize=8
+)
+
Return a copy where all tab characters are expanded using spaces.
+If tabsize is not given, a tab size of 8 characters is assumed.
+def find(
+ ...
+)
+
S.find(sub[, start[, end]]) -> int
+Return the lowest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Return -1 on failure.
+def format(
+ ...
+)
+
S.format(args, *kwargs) -> str
+Return a formatted version of S, using substitutions from args and kwargs. +The substitutions are identified by braces ('{' and '}').
+def format_map(
+ ...
+)
+
S.format_map(mapping) -> str
+Return a formatted version of S, using substitutions from mapping. +The substitutions are identified by braces ('{' and '}').
+def index(
+ ...
+)
+
S.index(sub[, start[, end]]) -> int
+Return the lowest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Raises ValueError when the substring is not found.
+def isalnum(
+ self,
+ /
+)
+
Return True if the string is an alpha-numeric string, False otherwise.
+A string is alpha-numeric if all characters in the string are alpha-numeric and +there is at least one character in the string.
+def isalpha(
+ self,
+ /
+)
+
Return True if the string is an alphabetic string, False otherwise.
+A string is alphabetic if all characters in the string are alphabetic and there +is at least one character in the string.
+def isascii(
+ self,
+ /
+)
+
Return True if all characters in the string are ASCII, False otherwise.
+ASCII characters have code points in the range U+0000-U+007F. +Empty string is ASCII too.
+def isdecimal(
+ self,
+ /
+)
+
Return True if the string is a decimal string, False otherwise.
+A string is a decimal string if all characters in the string are decimal and +there is at least one character in the string.
+def isdigit(
+ self,
+ /
+)
+
Return True if the string is a digit string, False otherwise.
+A string is a digit string if all characters in the string are digits and there +is at least one character in the string.
+def isidentifier(
+ self,
+ /
+)
+
Return True if the string is a valid Python identifier, False otherwise.
+Call keyword.iskeyword(s) to test whether string s is a reserved identifier, +such as "def" or "class".
+def islower(
+ self,
+ /
+)
+
Return True if the string is a lowercase string, False otherwise.
+A string is lowercase if all cased characters in the string are lowercase and +there is at least one cased character in the string.
+def isnumeric(
+ self,
+ /
+)
+
Return True if the string is a numeric string, False otherwise.
+A string is numeric if all characters in the string are numeric and there is at +least one character in the string.
+def isprintable(
+ self,
+ /
+)
+
Return True if the string is printable, False otherwise.
+A string is printable if all of its characters are considered printable in +repr() or if it is empty.
+def isspace(
+ self,
+ /
+)
+
Return True if the string is a whitespace string, False otherwise.
+A string is whitespace if all characters in the string are whitespace and there +is at least one character in the string.
+def istitle(
+ self,
+ /
+)
+
Return True if the string is a title-cased string, False otherwise.
+In a title-cased string, upper- and title-case characters may only +follow uncased characters and lowercase characters only cased ones.
+def isupper(
+ self,
+ /
+)
+
Return True if the string is an uppercase string, False otherwise.
+A string is uppercase if all cased characters in the string are uppercase and +there is at least one cased character in the string.
+def join(
+ self,
+ iterable,
+ /
+)
+
Concatenate any number of strings.
+The string whose method is called is inserted in between each given string. +The result is returned as a new string.
+Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
+def ljust(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a left-justified string of length width.
+Padding is done using the specified fill character (default is a space).
+def lower(
+ self,
+ /
+)
+
Return a copy of the string converted to lowercase.
+def lstrip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with leading whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def partition(
+ self,
+ sep,
+ /
+)
+
Partition the string into three parts using the given separator.
+This will search for the separator in the string. If the separator is found, +returns a 3-tuple containing the part before the separator, the separator +itself, and the part after it.
+If the separator is not found, returns a 3-tuple containing the original string +and two empty strings.
+def removeprefix(
+ self,
+ prefix,
+ /
+)
+
Return a str with the given prefix string removed if present.
+If the string starts with the prefix string, return string[len(prefix):]. +Otherwise, return a copy of the original string.
+def removesuffix(
+ self,
+ suffix,
+ /
+)
+
Return a str with the given suffix string removed if present.
+If the string ends with the suffix string and that suffix is not empty, +return string[:-len(suffix)]. Otherwise, return a copy of the original +string.
+def replace(
+ self,
+ old,
+ new,
+ count=-1,
+ /
+)
+
Return a copy with all occurrences of substring old replaced by new.
+count + Maximum number of occurrences to replace. + -1 (the default value) means replace all occurrences.
+If the optional argument count is given, only the first count occurrences are +replaced.
+def rfind(
+ ...
+)
+
S.rfind(sub[, start[, end]]) -> int
+Return the highest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Return -1 on failure.
+def rindex(
+ ...
+)
+
S.rindex(sub[, start[, end]]) -> int
+Return the highest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Raises ValueError when the substring is not found.
+def rjust(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a right-justified string of length width.
+Padding is done using the specified fill character (default is a space).
+def rpartition(
+ self,
+ sep,
+ /
+)
+
Partition the string into three parts using the given separator.
+This will search for the separator in the string, starting at the end. If +the separator is found, returns a 3-tuple containing the part before the +separator, the separator itself, and the part after it.
+If the separator is not found, returns a 3-tuple containing two empty strings +and the original string.
+def rsplit(
+ self,
+ /,
+ sep=None,
+ maxsplit=-1
+)
+
Return a list of the substrings in the string, using sep as the separator string.
+sep + The separator used to split the string.
+When set to None (the default value), will split on any whitespace
+character (including \n \r \t \f and spaces) and will discard
+empty strings from the result.
+
maxsplit + Maximum number of splits. + -1 (the default value) means no limit.
+Splitting starts at the end of the string and works to the front.
+def rstrip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with trailing whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def split(
+ self,
+ /,
+ sep=None,
+ maxsplit=-1
+)
+
Return a list of the substrings in the string, using sep as the separator string.
+sep + The separator used to split the string.
+When set to None (the default value), will split on any whitespace
+character (including \n \r \t \f and spaces) and will discard
+empty strings from the result.
+
maxsplit + Maximum number of splits. + -1 (the default value) means no limit.
+Splitting starts at the front of the string and works to the end.
+Note, str.split() is mainly useful for data that has been intentionally +delimited. With natural text that includes punctuation, consider using +the regular expression module.
+def splitlines(
+ self,
+ /,
+ keepends=False
+)
+
Return a list of the lines in the string, breaking at line boundaries.
+Line breaks are not included in the resulting list unless keepends is given and +true.
+def startswith(
+ ...
+)
+
S.startswith(prefix[, start[, end]]) -> bool
+Return True if S starts with the specified prefix, False otherwise. +With optional start, test S beginning at that position. +With optional end, stop comparing S at that position. +prefix can also be a tuple of strings to try.
+def strip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with leading and trailing whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def swapcase(
+ self,
+ /
+)
+
Convert uppercase characters to lowercase and lowercase characters to uppercase.
+def title(
+ self,
+ /
+)
+
Return a version of the string where each word is titlecased.
+More specifically, words start with uppercased characters and all remaining +cased characters have lower case.
+def translate(
+ self,
+ table,
+ /
+)
+
Replace each character in the string using the given translation table.
+table + Translation table, which must be a mapping of Unicode ordinals to + Unicode ordinals, strings, or None.
+The table must implement lookup/indexing via getitem, for instance a +dictionary or list. If this operation raises LookupError, the character is +left untouched. Characters mapped to None are deleted.
+def upper(
+ self,
+ /
+)
+
Return a copy of the string converted to uppercase.
+def zfill(
+ self,
+ width,
+ /
+)
+
Pad a numeric string with zeros on the left, to fill a field of the given width.
+The string is never truncated.
+class OptionalHeader(
+ *args,
+ **kwds
+)
+
Optional Header to add in responses.
+name
+
server_timing
+
value
+
x_assets
+
def maketrans(
+ ...
+)
+
Return a translation table usable for str.translate().
+If there is only one argument, it must be a dictionary mapping Unicode +ordinals (integers) or characters to Unicode ordinals, strings or None. +Character keys will be then converted to ordinals. +If there are two arguments, they must be strings of equal length, and +in the resulting dictionary, each character in x will be mapped to the +character at the same position in y. If there is a third argument, it +must be a string, whose characters will be mapped to None in the result.
+def capitalize(
+ self,
+ /
+)
+
Return a capitalized version of the string.
+More specifically, make the first character have upper case and the rest lower +case.
+def casefold(
+ self,
+ /
+)
+
Return a version of the string suitable for caseless comparisons.
+def center(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a centered string of length width.
+Padding is done using the specified fill character (default is a space).
+def count(
+ ...
+)
+
S.count(sub[, start[, end]]) -> int
+Return the number of non-overlapping occurrences of substring sub in +string S[start:end]. Optional arguments start and end are +interpreted as in slice notation.
+def encode(
+ self,
+ /,
+ encoding='utf-8',
+ errors='strict'
+)
+
Encode the string using the codec registered for encoding.
+encoding + The encoding in which to encode the string. +errors + The error handling scheme to use for encoding errors. + The default is 'strict' meaning that encoding errors raise a + UnicodeEncodeError. Other possible values are 'ignore', 'replace' and + 'xmlcharrefreplace' as well as any other name registered with + codecs.register_error that can handle UnicodeEncodeErrors.
+def endswith(
+ ...
+)
+
S.endswith(suffix[, start[, end]]) -> bool
+Return True if S ends with the specified suffix, False otherwise. +With optional start, test S beginning at that position. +With optional end, stop comparing S at that position. +suffix can also be a tuple of strings to try.
+def expandtabs(
+ self,
+ /,
+ tabsize=8
+)
+
Return a copy where all tab characters are expanded using spaces.
+If tabsize is not given, a tab size of 8 characters is assumed.
+def find(
+ ...
+)
+
S.find(sub[, start[, end]]) -> int
+Return the lowest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Return -1 on failure.
+def format(
+ ...
+)
+
S.format(args, *kwargs) -> str
+Return a formatted version of S, using substitutions from args and kwargs. +The substitutions are identified by braces ('{' and '}').
+def format_map(
+ ...
+)
+
S.format_map(mapping) -> str
+Return a formatted version of S, using substitutions from mapping. +The substitutions are identified by braces ('{' and '}').
+def index(
+ ...
+)
+
S.index(sub[, start[, end]]) -> int
+Return the lowest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Raises ValueError when the substring is not found.
+def isalnum(
+ self,
+ /
+)
+
Return True if the string is an alpha-numeric string, False otherwise.
+A string is alpha-numeric if all characters in the string are alpha-numeric and +there is at least one character in the string.
+def isalpha(
+ self,
+ /
+)
+
Return True if the string is an alphabetic string, False otherwise.
+A string is alphabetic if all characters in the string are alphabetic and there +is at least one character in the string.
+def isascii(
+ self,
+ /
+)
+
Return True if all characters in the string are ASCII, False otherwise.
+ASCII characters have code points in the range U+0000-U+007F. +Empty string is ASCII too.
+def isdecimal(
+ self,
+ /
+)
+
Return True if the string is a decimal string, False otherwise.
+A string is a decimal string if all characters in the string are decimal and +there is at least one character in the string.
+def isdigit(
+ self,
+ /
+)
+
Return True if the string is a digit string, False otherwise.
+A string is a digit string if all characters in the string are digits and there +is at least one character in the string.
+def isidentifier(
+ self,
+ /
+)
+
Return True if the string is a valid Python identifier, False otherwise.
+Call keyword.iskeyword(s) to test whether string s is a reserved identifier, +such as "def" or "class".
+def islower(
+ self,
+ /
+)
+
Return True if the string is a lowercase string, False otherwise.
+A string is lowercase if all cased characters in the string are lowercase and +there is at least one cased character in the string.
+def isnumeric(
+ self,
+ /
+)
+
Return True if the string is a numeric string, False otherwise.
+A string is numeric if all characters in the string are numeric and there is at +least one character in the string.
+def isprintable(
+ self,
+ /
+)
+
Return True if the string is printable, False otherwise.
+A string is printable if all of its characters are considered printable in +repr() or if it is empty.
+def isspace(
+ self,
+ /
+)
+
Return True if the string is a whitespace string, False otherwise.
+A string is whitespace if all characters in the string are whitespace and there +is at least one character in the string.
+def istitle(
+ self,
+ /
+)
+
Return True if the string is a title-cased string, False otherwise.
+In a title-cased string, upper- and title-case characters may only +follow uncased characters and lowercase characters only cased ones.
+def isupper(
+ self,
+ /
+)
+
Return True if the string is an uppercase string, False otherwise.
+A string is uppercase if all cased characters in the string are uppercase and +there is at least one cased character in the string.
+def join(
+ self,
+ iterable,
+ /
+)
+
Concatenate any number of strings.
+The string whose method is called is inserted in between each given string. +The result is returned as a new string.
+Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
+def ljust(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a left-justified string of length width.
+Padding is done using the specified fill character (default is a space).
+def lower(
+ self,
+ /
+)
+
Return a copy of the string converted to lowercase.
+def lstrip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with leading whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def partition(
+ self,
+ sep,
+ /
+)
+
Partition the string into three parts using the given separator.
+This will search for the separator in the string. If the separator is found, +returns a 3-tuple containing the part before the separator, the separator +itself, and the part after it.
+If the separator is not found, returns a 3-tuple containing the original string +and two empty strings.
+def removeprefix(
+ self,
+ prefix,
+ /
+)
+
Return a str with the given prefix string removed if present.
+If the string starts with the prefix string, return string[len(prefix):]. +Otherwise, return a copy of the original string.
+def removesuffix(
+ self,
+ suffix,
+ /
+)
+
Return a str with the given suffix string removed if present.
+If the string ends with the suffix string and that suffix is not empty, +return string[:-len(suffix)]. Otherwise, return a copy of the original +string.
+def replace(
+ self,
+ old,
+ new,
+ count=-1,
+ /
+)
+
Return a copy with all occurrences of substring old replaced by new.
+count + Maximum number of occurrences to replace. + -1 (the default value) means replace all occurrences.
+If the optional argument count is given, only the first count occurrences are +replaced.
+def rfind(
+ ...
+)
+
S.rfind(sub[, start[, end]]) -> int
+Return the highest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Return -1 on failure.
+def rindex(
+ ...
+)
+
S.rindex(sub[, start[, end]]) -> int
+Return the highest index in S where substring sub is found, +such that sub is contained within S[start:end]. Optional +arguments start and end are interpreted as in slice notation.
+Raises ValueError when the substring is not found.
+def rjust(
+ self,
+ width,
+ fillchar=' ',
+ /
+)
+
Return a right-justified string of length width.
+Padding is done using the specified fill character (default is a space).
+def rpartition(
+ self,
+ sep,
+ /
+)
+
Partition the string into three parts using the given separator.
+This will search for the separator in the string, starting at the end. If +the separator is found, returns a 3-tuple containing the part before the +separator, the separator itself, and the part after it.
+If the separator is not found, returns a 3-tuple containing two empty strings +and the original string.
+def rsplit(
+ self,
+ /,
+ sep=None,
+ maxsplit=-1
+)
+
Return a list of the substrings in the string, using sep as the separator string.
+sep + The separator used to split the string.
+When set to None (the default value), will split on any whitespace
+character (including \n \r \t \f and spaces) and will discard
+empty strings from the result.
+
maxsplit + Maximum number of splits. + -1 (the default value) means no limit.
+Splitting starts at the end of the string and works to the front.
+def rstrip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with trailing whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def split(
+ self,
+ /,
+ sep=None,
+ maxsplit=-1
+)
+
Return a list of the substrings in the string, using sep as the separator string.
+sep + The separator used to split the string.
+When set to None (the default value), will split on any whitespace
+character (including \n \r \t \f and spaces) and will discard
+empty strings from the result.
+
maxsplit + Maximum number of splits. + -1 (the default value) means no limit.
+Splitting starts at the front of the string and works to the end.
+Note, str.split() is mainly useful for data that has been intentionally +delimited. With natural text that includes punctuation, consider using +the regular expression module.
+def splitlines(
+ self,
+ /,
+ keepends=False
+)
+
Return a list of the lines in the string, breaking at line boundaries.
+Line breaks are not included in the resulting list unless keepends is given and +true.
+def startswith(
+ ...
+)
+
S.startswith(prefix[, start[, end]]) -> bool
+Return True if S starts with the specified prefix, False otherwise. +With optional start, test S beginning at that position. +With optional end, stop comparing S at that position. +prefix can also be a tuple of strings to try.
+def strip(
+ self,
+ chars=None,
+ /
+)
+
Return a copy of the string with leading and trailing whitespace removed.
+If chars is given and not None, remove characters in chars instead.
+def swapcase(
+ self,
+ /
+)
+
Convert uppercase characters to lowercase and lowercase characters to uppercase.
+def title(
+ self,
+ /
+)
+
Return a version of the string where each word is titlecased.
+More specifically, words start with uppercased characters and all remaining +cased characters have lower case.
+def translate(
+ self,
+ table,
+ /
+)
+
Replace each character in the string using the given translation table.
+table + Translation table, which must be a mapping of Unicode ordinals to + Unicode ordinals, strings, or None.
+The table must implement lookup/indexing via getitem, for instance a +dictionary or list. If this operation raises LookupError, the character is +left untouched. Characters mapped to None are deleted.
+def upper(
+ self,
+ /
+)
+
Return a copy of the string converted to uppercase.
+def zfill(
+ self,
+ width,
+ /
+)
+
Pad a numeric string with zeros on the left, to fill a field of the given width.
+The string is never truncated.
+ + + + + + + + + + + + + + + + + + +Custom routing classes.
+def add_route_dependencies(
+ routes: List[starlette.routing.BaseRoute],
+ *,
+ scopes: List[titiler.core.routing.EndpointScope],
+ dependencies=typing.List[fastapi.params.Depends]
+)
+
Add dependencies to routes.
+Allows a developer to add dependencies to a route after the route has been defined.
+def apiroute_factory(
+ env: Optional[Dict] = None
+) -> Type[fastapi.routing.APIRoute]
+
Create Custom API Route class with custom Env.
+Because we cannot create middleware for specific router we need to create
+a custom APIRoute which add the rasterio.Env(
block before the endpoint is
+actually called. This way we set the env outside the threads and we make sure
+that event multithreaded Reader will get the environment set.
Note: This has been tested in python 3.6 and 3.7 only.
+class EndpointScope(
+ /,
+ *args,
+ **kwargs
+)
+
Define endpoint.
+def clear(
+ ...
+)
+
D.clear() -> None. Remove all items from D.
+def copy(
+ ...
+)
+
D.copy() -> a shallow copy of D
+def fromkeys(
+ iterable,
+ value=None,
+ /
+)
+
Create a new dictionary with keys from iterable and values set to value.
+def get(
+ self,
+ key,
+ default=None,
+ /
+)
+
Return the value for key if key is in the dictionary, else default.
+def items(
+ ...
+)
+
D.items() -> a set-like object providing a view on D's items
+def keys(
+ ...
+)
+
D.keys() -> a set-like object providing a view on D's keys
+def pop(
+ ...
+)
+
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
+If the key is not found, return the default if given; otherwise, +raise a KeyError.
+def popitem(
+ self,
+ /
+)
+
Remove and return a (key, value) pair as a 2-tuple.
+Pairs are returned in LIFO (last-in, first-out) order. +Raises KeyError if the dict is empty.
+def setdefault(
+ self,
+ key,
+ default=None,
+ /
+)
+
Insert key with a value of default if key is not in the dictionary.
+Return the value for key if key is in the dictionary, else default.
+def update(
+ ...
+)
+
D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
+If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] +If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v +In either case, this is followed by: for k in F: D[k] = F[k]
+def values(
+ ...
+)
+
D.values() -> an object providing a view on D's values
+ + + + + + + + + + + + + + + + + + +rio-cogeo Extension.
+class cogValidateExtension(
+
+)
+
Add /validate endpoint to a COG TilerFactory.
+def register(
+ self,
+ factory: titiler.core.factory.BaseTilerFactory
+)
+
Register endpoint to the tiler factory.
+ + + + + + + + + + + + + + + + + + +rio-stac Extension.
+class Item(
+ /,
+ *args,
+ **kwargs
+)
+
STAC Item.
+def clear(
+ ...
+)
+
D.clear() -> None. Remove all items from D.
+def copy(
+ ...
+)
+
D.copy() -> a shallow copy of D
+def fromkeys(
+ iterable,
+ value=None,
+ /
+)
+
Create a new dictionary with keys from iterable and values set to value.
+def get(
+ self,
+ key,
+ default=None,
+ /
+)
+
Return the value for key if key is in the dictionary, else default.
+def items(
+ ...
+)
+
D.items() -> a set-like object providing a view on D's items
+def keys(
+ ...
+)
+
D.keys() -> a set-like object providing a view on D's keys
+def pop(
+ ...
+)
+
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
+If the key is not found, return the default if given; otherwise, +raise a KeyError.
+def popitem(
+ self,
+ /
+)
+
Remove and return a (key, value) pair as a 2-tuple.
+Pairs are returned in LIFO (last-in, first-out) order. +Raises KeyError if the dict is empty.
+def setdefault(
+ self,
+ key,
+ default=None,
+ /
+)
+
Insert key with a value of default if key is not in the dictionary.
+Return the value for key if key is in the dictionary, else default.
+def update(
+ ...
+)
+
D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
+If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] +If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v +In either case, this is followed by: for k in F: D[k] = F[k]
+def values(
+ ...
+)
+
D.values() -> an object providing a view on D's values
+class stacExtension(
+
+)
+
Add /stac endpoint to a COG TilerFactory.
+def register(
+ self,
+ factory: titiler.core.factory.BaseTilerFactory
+)
+
Register endpoint to the tiler factory.
+ + + + + + + + + + + + + + + + + + +titiler Viewer Extensions.
+DEFAULT_TEMPLATES
+
jinja2_env
+
class cogViewerExtension(
+ templates: starlette.templating.Jinja2Templates = <starlette.templating.Jinja2Templates object at 0x7fae43c57ad0>
+)
+
Add /viewer endpoint to the TilerFactory.
+templates
+
def register(
+ self,
+ factory: titiler.core.factory.BaseTilerFactory
+)
+
Register endpoint to the tiler factory.
+class stacViewerExtension(
+ templates: starlette.templating.Jinja2Templates = <starlette.templating.Jinja2Templates object at 0x7fae43c57ad0>
+)
+
Add /viewer endpoint to the TilerFactory.
+templates
+
def register(
+ self,
+ factory: titiler.core.factory.BaseTilerFactory
+)
+
Register endpoint to the tiler factory.
+ + + + + + + + + + + + + + + + + + +TiTiler.mosaic Router factories.
+MAX_THREADS
+
WGS84_CRS
+
img_endpoint_params
+
def PixelSelectionParams(
+ pixel_selection: Annotated[Literal['first', 'highest', 'lowest', 'mean', 'median', 'stdev', 'lastbandlow', 'lastbandhight', 'count'], Query(PydanticUndefined)] = 'first'
+) -> rio_tiler.mosaic.methods.base.MosaicMethodBase
+
Returns the mosaic method used to combine datasets together.
+class MosaicTilerFactory(
+ reader: Type[cogeo_mosaic.backends.base.BaseBackend] = <function MosaicBackend at 0x7f3816b92fc0>,
+ router: fastapi.routing.APIRouter = <factory>,
+ path_dependency: Callable[..., Any] = <function DatasetPathParams at 0x7f38160ee480>,
+ layer_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.BidxExprParams'>,
+ dataset_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DatasetParams'>,
+ process_dependency: Callable[..., Optional[titiler.core.algorithm.base.BaseAlgorithm]] = <function Algorithms.dependency.<locals>.post_process at 0x7f3815f240e0>,
+ rescale_dependency: Callable[..., Optional[List[Tuple[float, ...]]]] = <function RescalingParams at 0x7f38160ef600>,
+ color_formula_dependency: Callable[..., Optional[str]] = <function ColorFormulaParams at 0x7f3816186340>,
+ colormap_dependency: Callable[..., Union[Dict[int, Tuple[int, int, int, int]], Sequence[Tuple[Tuple[Union[float, int], Union[float, int]], Tuple[int, int, int, int]]], NoneType]] = <function create_colormap_dependency.<locals>.deps at 0x7f38160ed300>,
+ render_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.ImageRenderingParams'>,
+ reader_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DefaultDependency'>,
+ environment_dependency: Callable[..., Dict] = <function BaseTilerFactory.<lambda> at 0x7f3815f24180>,
+ supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WGS1984Quad.json'), 'WebMercatorQuad': <TileMatrixSet title='Google Maps Compatible for the World' id='WebMercatorQuad' crs='http://www.opengis.net/def/crs/EPSG/0/3857>, 'WorldCRS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
+ default_tms: Optional[str] = None,
+ router_prefix: str = '',
+ optional_headers: List[titiler.core.resources.enums.OptionalHeader] = <factory>,
+ route_dependencies: List[Tuple[List[titiler.core.routing.EndpointScope], List[fastapi.params.Depends]]] = <factory>,
+ extensions: List[titiler.core.factory.FactoryExtension] = <factory>,
+ templates: starlette.templating.Jinja2Templates = <starlette.templating.Jinja2Templates object at 0x7f3816ed3ad0>,
+ dataset_reader: Union[Type[rio_tiler.io.base.BaseReader], Type[rio_tiler.io.base.MultiBaseReader], Type[rio_tiler.io.base.MultiBandReader]] = <class 'rio_tiler.io.rasterio.Reader'>,
+ backend_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DefaultDependency'>,
+ pixel_selection_dependency: Callable[..., rio_tiler.mosaic.methods.base.MosaicMethodBase] = <function PixelSelectionParams at 0x7f3820b20c20>,
+ tile_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.TileParams'>,
+ add_viewer: bool = True
+)
+
MosaicTiler Factory.
+The main difference with titiler.endpoint.factory.TilerFactory is that this factory
+needs the reader
to be of cogeo_mosaic.backends.BaseBackend
type (e.g MosaicBackend) and a dataset_reader
(BaseReader).
add_viewer
+
backend_dependency
+
dataset_dependency
+
dataset_reader
+
default_tms
+
layer_dependency
+
reader_dependency
+
render_dependency
+
router_prefix
+
supported_tms
+
templates
+
tile_dependency
+
def add_route_dependencies(
+ self,
+ *,
+ scopes: List[titiler.core.routing.EndpointScope],
+ dependencies=typing.List[fastapi.params.Depends]
+)
+
Add dependencies to routes.
+Allows a developer to add dependencies to a route after the route has been defined.
+def assets(
+ self
+)
+
Register /assets endpoint.
+def bounds(
+ self
+)
+
Register /bounds endpoint.
+def color_formula_dependency(
+ color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[str]
+
ColorFormula Parameter.
+def colormap_dependency(
+ colormap_name: Annotated[Literal['flag_r', 'gist_earth_r', 'cool', 'rdpu_r', 'matter_r', 'tempo_r', 'brbg', 'bwr_r', 'wistia', 'gist_yarg', 'ylgn', 'tarn_r', 'puor', 'purd', 'bupu', 'viridis_r', 'rdylbu_r', 'thermal_r', 'purples_r', 'gnuplot', 'winter', 'twilight_shifted_r', 'gnuplot_r', 'prism', 'viridis', 'pubugn_r', 'oxy', 'haline', 'ylorbr', 'winter_r', 'solar', 'gist_heat', 'rdylbu', 'dark2', 'dark2_r', 'terrain_r', 'set3', 'gray_r', 'tab20_r', 'brbg_r', 'rdylgn', 'twilight', 'balance_r', 'summer', 'hot', 'turbid', 'diff', 'speed', 'cmrmap', 'set3_r', 'pastel1', 'piyg_r', 'deep', 'greens_r', 'inferno_r', 'curl_r', 'pubugn', 'seismic_r', 'cmrmap_r', 'hsv_r', 'ylorrd', 'dense', 'oxy_r', 'bwr', 'bone', 'set1_r', 'pastel2', 'reds', 'delta_r', 'gist_rainbow_r', 'orrd_r', 'phase_r', 'pink', 'rainbow_r', 'set2_r', 'bugn', 'ocean', 'copper', 'gist_ncar', 'cubehelix', 'spring_r', 'cool_r', 'ocean_r', 'thermal', 'tab10_r', 'cividis', 'nipy_spectral', 'copper_r', 'inferno', 'amp_r', 'speed_r', 'tab10', 'gist_earth', 'prism_r', 'rdylgn_r', 'twilight_shifted', 'pubu', 'prgn_r', 'gist_gray', 'gray', 'pubu_r', 'purd_r', 'jet', 'flag', 'ice_r', 'tab20c_r', 'paired_r', 'cividis_r', 'gnbu_r', 'autumn_r', 'cfastie', 'spring', 'magma_r', 'rain_r', 'bugn_r', 'afmhot', 'pastel2_r', 'brg_r', 'puor_r', 'nipy_spectral_r', 'gist_stern', 'phase', 'deep_r', 'tempo', 'gist_ncar_r', 'amp', 'balance', 'spectral', 'cubehelix_r', 'delta', 'rain', 'diff_r', 'magma', 'greens', 'reds_r', 'gist_heat_r', 'piyg', 'set1', 'topo_r', 'bone_r', 'binary_r', 'tab20c', 'rdgy_r', 'wistia_r', 'topo', 'algae_r', 'autumn', 'gist_yarg_r', 'ylorrd_r', 'rdbu_r', 'pink_r', 'paired', 'matter', 'terrain', 'twilight_r', 'oranges', 'brg', 'ylgnbu_r', 'purples', 'set2', 'plasma', 'ylorbr_r', 'spectral_r', 'plasma_r', 'coolwarm', 'turbo_r', 'binary', 'schwarzwald', 'rdpu', 'greys_r', 'coolwarm_r', 'tarn', 'algae', 'oranges_r', 'rainbow', 'orrd', 'curl', 'accent', 'rplumbo', 'afmhot_r', 'turbo', 'hsv', 'ylgn_r', 'blues', 'tab20b', 'accent_r', 'ice', 'gist_stern_r', 'blues_r', 'rdbu', 'hot_r', 'jet_r', 'seismic', 'summer_r', 'ylgnbu', 'tab20b_r', 'pastel1_r', 'rdgy', 'gist_rainbow', 'dense_r', 'turbid_r', 'bupu_r', 'solar_r', 'gnbu', 'prgn', 'greys', 'tab20', 'haline_r', 'gist_gray_r', 'gnuplot2_r', 'gnuplot2'], Query(PydanticUndefined)] = None,
+ colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
+)
+
def environment_dependency(
+
+)
+
def info(
+ self
+)
+
Register /info endpoint
+def map_viewer(
+ self
+)
+
Register /map endpoint.
+def path_dependency(
+ url: typing.Annotated[str, Query(PydanticUndefined)]
+) -> str
+
Create dataset path from args
+def pixel_selection_dependency(
+ pixel_selection: Annotated[Literal['first', 'highest', 'lowest', 'mean', 'median', 'stdev', 'lastbandlow', 'lastbandhight', 'count'], Query(PydanticUndefined)] = 'first'
+) -> rio_tiler.mosaic.methods.base.MosaicMethodBase
+
Returns the mosaic method used to combine datasets together.
+def point(
+ self
+)
+
Register /point endpoint.
+def process_dependency(
+ algorithm: Annotated[Literal['hillshade', 'contours', 'normalizedIndex', 'terrarium', 'terrainrgb'], Query(PydanticUndefined)] = None,
+ algorithm_params: Annotated[Optional[str], Query(PydanticUndefined)] = None
+) -> Optional[titiler.core.algorithm.base.BaseAlgorithm]
+
Data Post-Processing options.
+def read(
+ self
+)
+
Register / (Get) Read endpoint.
+def reader(
+ input: str,
+ *args: Any,
+ **kwargs: Any
+) -> cogeo_mosaic.backends.base.BaseBackend
+
Select mosaic backend for input.
+def register_routes(
+ self
+)
+
This Method register routes to the router.
+Because we wrap the endpoints in a class we cannot define the routes as +methods (because of the self argument). The HACK is to define routes inside +the class method and register them after the class initialization.
+def rescale_dependency(
+ rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
+) -> Optional[List[Tuple[float, ...]]]
+
Min/Max data Rescaling
+def tile(
+ self
+)
+
Register /tiles endpoints.
+def tilejson(
+ self
+)
+
Add tilejson endpoint.
+def url_for(
+ self,
+ request: starlette.requests.Request,
+ name: str,
+ **path_params: Any
+) -> str
+
Return full url (with prefix) for a specific endpoint.
+def validate(
+ self
+)
+
Register /validate endpoint.
+def wmts(
+ self
+)
+
Add wmts endpoint.
+ + + + + + + + + + + + + + + + + + +Titiler.mosaic Enums.
+None
+class PixelSelectionMethod(
+ /,
+ *args,
+ **kwargs
+)
+
first
+
highest
+
lowest
+
mean
+
median
+
name
+
stdev
+
value
+