Skip to content

Module titiler.core.factory

TiTiler Router factories.

Variables

DEFAULT_TEMPLATES
WGS84_CRS
img_endpoint_params
jinja2_env

Classes

AlgorithmFactory

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.

Class variables

supported_algorithm

BaseTilerFactory

class BaseTilerFactory(
    reader: Type[rio_tiler.io.base.BaseReader],
    router: fastapi.routing.APIRouter = <factory>,
    path_dependency: Callable[..., Any] = <function DatasetPathParams at 0x7f6c7333bce0>,
    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 0x7f6c69ab4c20>,
    rescale_dependency: Callable[..., Optional[List[Tuple[float, ...]]]] = <function RescalingParams at 0x7f6c69ddae80>,
    color_formula_dependency: Callable[..., Optional[str]] = <function ColorFormulaParams at 0x7f6c69df5a80>,
    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 0x7f6c73f436a0>,
    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 0x7f6c69ab4cc0>,
    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 0x7f6c6a211d10>
)

BaseTiler Factory.

Abstract Base Class which defines most inputs used by dynamic tiler.

Attributes

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

Descendants

  • titiler.core.factory.TilerFactory

Class variables

dataset_dependency
default_tms
layer_dependency
reader_dependency
render_dependency
router_prefix
supported_tms
templates

Methods

add_route_dependencies

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.

color_formula_dependency

def color_formula_dependency(
    color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
) -> Optional[str]

ColorFormula Parameter.

colormap_dependency

def colormap_dependency(
    colormap_name: Annotated[Literal['plasma_r', 'pastel2', 'rdylbu_r', 'cividis', 'purples_r', 'twilight_shifted_r', 'brbg_r', 'gist_ncar_r', 'tarn', 'set1_r', 'rainbow_r', 'bupu_r', 'turbid', 'diff', 'turbid_r', 'ice_r', 'ocean', 'accent_r', 'hot', 'reds_r', 'rdylgn_r', 'gist_yarg', 'hsv', 'nipy_spectral_r', 'greens', 'inferno_r', 'ylgnbu', 'prism_r', 'winter', 'set2_r', 'gnuplot2', 'gnuplot2_r', 'set3', 'speed', 'seismic_r', 'cool', 'bwr', 'purples', 'topo_r', 'spring_r', 'blues', 'rdpu_r', 'terrain_r', 'pastel2_r', 'brg_r', 'rain_r', 'binary_r', 'gist_heat', 'tarn_r', 'amp_r', 'topo', 'prgn', 'phase_r', 'gist_ncar', 'blues_r', 'delta_r', 'tab20_r', 'delta', 'solar_r', 'summer_r', 'oranges', 'tempo', 'spectral_r', 'gist_earth', 'gnuplot', 'piyg', 'viridis', 'orrd', 'cubehelix_r', 'phase', 'magma_r', 'viridis_r', 'twilight_r', 'wistia', 'curl', 'cividis_r', 'tab20b', 'gist_rainbow', 'winter_r', 'pastel1_r', 'flag_r', 'ocean_r', 'bugn', 'rdgy', 'rain', 'algae_r', 'wistia_r', 'accent', 'tempo_r', 'afmhot', 'amp', 'rdbu_r', 'puor_r', 'ylorrd', 'pubu_r', 'brbg', 'pink_r', 'greys_r', 'pubugn_r', 'cmrmap', 'flag', 'turbo', 'oxy_r', 'ylorbr_r', 'matter_r', 'twilight', 'deep', 'purd', 'coolwarm', 'gist_rainbow_r', 'spring', 'autumn', 'spectral', 'hot_r', 'coolwarm_r', 'schwarzwald', 'tab10_r', 'speed_r', 'ylgn_r', 'gnuplot_r', 'gist_heat_r', 'rdylbu', 'orrd_r', 'piyg_r', 'balance', 'balance_r', 'pubu', 'pink', 'prgn_r', 'inferno', 'bupu', 'dark2_r', 'deep_r', 'matter', 'jet', 'tab20c_r', 'diff_r', 'nipy_spectral', 'gist_earth_r', 'gist_stern_r', 'haline', 'turbo_r', 'prism', 'purd_r', 'haline_r', 'rplumbo', 'gist_gray', 'greens_r', 'gray', 'algae', 'tab10', 'hsv_r', 'autumn_r', 'rdpu', 'thermal_r', 'oxy', 'cmrmap_r', 'cubehelix', 'ylgnbu_r', 'dense', 'bugn_r', 'gist_stern', 'tab20', 'ylorbr', 'summer', 'rdylgn', 'tab20b_r', 'jet_r', 'paired_r', 'dark2', 'binary', 'twilight_shifted', 'seismic', 'pubugn', 'ylgn', 'rdbu', 'bone', 'tab20c', 'dense_r', 'gnbu', 'set2', 'paired', 'gnbu_r', 'copper_r', 'gist_yarg_r', 'pastel1', 'bwr_r', 'greys', 'puor', 'oranges_r', 'cool_r', 'afmhot_r', 'rdgy_r', 'bone_r', 'thermal', 'ice', 'gray_r', 'copper', 'cfastie', 'curl_r', 'reds', 'brg', 'solar', 'ylorrd_r', 'magma', 'plasma', 'set3_r', 'rainbow', 'terrain', 'gist_gray_r', 'set1'], Query(PydanticUndefined)] = None,
    colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
)

environment_dependency

def environment_dependency(

)

path_dependency

def path_dependency(
    url: typing.Annotated[str, Query(PydanticUndefined)]
) -> str

Create dataset path from args

process_dependency

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.

register_routes

def register_routes(
    self
)

Register Tiler Routes.

rescale_dependency

def rescale_dependency(
    rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
) -> Optional[List[Tuple[float, ...]]]

Min/Max data Rescaling

url_for

def url_for(
    self,
    request: starlette.requests.Request,
    name: str,
    **path_params: Any
) -> str

Return full url (with prefix) for a specific endpoint.

ColorMapFactory

class ColorMapFactory(
    supported_colormaps: rio_tiler.colormap.ColorMaps = ColorMaps(data={'plasma_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/plasma_r.npy', 'pastel2': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pastel2.npy', 'rdylbu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdylbu_r.npy', 'cividis': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cividis.npy', 'purples_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/purples_r.npy', 'twilight_shifted_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/twilight_shifted_r.npy', 'brbg_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/brbg_r.npy', 'gist_ncar_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_ncar_r.npy', 'tarn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tarn.npy', 'set1_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set1_r.npy', 'rainbow_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rainbow_r.npy', 'bupu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bupu_r.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', 'turbid_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/turbid_r.npy', 'ice_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ice_r.npy', 'ocean': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ocean.npy', 'accent_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/accent_r.npy', 'hot': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/hot.npy', 'reds_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/reds_r.npy', 'rdylgn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdylgn_r.npy', 'gist_yarg': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_yarg.npy', 'hsv': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/hsv.npy', 'nipy_spectral_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/nipy_spectral_r.npy', 'greens': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/greens.npy', 'inferno_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/inferno_r.npy', 'ylgnbu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylgnbu.npy', 'prism_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/prism_r.npy', 'winter': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/winter.npy', 'set2_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set2_r.npy', 'gnuplot2': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnuplot2.npy', 'gnuplot2_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnuplot2_r.npy', 'set3': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set3.npy', 'speed': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/speed.npy', 'seismic_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/seismic_r.npy', 'cool': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cool.npy', 'bwr': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bwr.npy', 'purples': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/purples.npy', 'topo_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/topo_r.npy', 'spring_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/spring_r.npy', 'blues': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/blues.npy', 'rdpu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdpu_r.npy', 'terrain_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/terrain_r.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', 'rain_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rain_r.npy', 'binary_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/binary_r.npy', 'gist_heat': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_heat.npy', 'tarn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tarn_r.npy', 'amp_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/amp_r.npy', 'topo': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/topo.npy', 'prgn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/prgn.npy', 'phase_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/phase_r.npy', 'gist_ncar': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_ncar.npy', 'blues_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/blues_r.npy', 'delta_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/delta_r.npy', 'tab20_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20_r.npy', 'delta': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/delta.npy', 'solar_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/solar_r.npy', 'summer_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/summer_r.npy', 'oranges': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/oranges.npy', 'tempo': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tempo.npy', 'spectral_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/spectral_r.npy', 'gist_earth': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_earth.npy', 'gnuplot': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnuplot.npy', 'piyg': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/piyg.npy', 'viridis': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/viridis.npy', 'orrd': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/orrd.npy', 'cubehelix_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cubehelix_r.npy', 'phase': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/phase.npy', 'magma_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/magma_r.npy', 'viridis_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/viridis_r.npy', 'twilight_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/twilight_r.npy', 'wistia': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/wistia.npy', 'curl': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/curl.npy', 'cividis_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cividis_r.npy', 'tab20b': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20b.npy', 'gist_rainbow': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_rainbow.npy', 'winter_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/winter_r.npy', 'pastel1_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pastel1_r.npy', 'flag_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/flag_r.npy', 'ocean_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ocean_r.npy', 'bugn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bugn.npy', 'rdgy': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdgy.npy', 'rain': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rain.npy', 'algae_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/algae_r.npy', 'wistia_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/wistia_r.npy', 'accent': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/accent.npy', 'tempo_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tempo_r.npy', 'afmhot': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/afmhot.npy', 'amp': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/amp.npy', 'rdbu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdbu_r.npy', 'puor_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/puor_r.npy', 'ylorrd': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylorrd.npy', 'pubu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pubu_r.npy', 'brbg': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/brbg.npy', 'pink_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pink_r.npy', 'greys_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/greys_r.npy', 'pubugn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pubugn_r.npy', 'cmrmap': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cmrmap.npy', 'flag': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/flag.npy', 'turbo': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/turbo.npy', 'oxy_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/oxy_r.npy', 'ylorbr_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylorbr_r.npy', 'matter_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/matter_r.npy', 'twilight': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/twilight.npy', 'deep': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/deep.npy', 'purd': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/purd.npy', 'coolwarm': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/coolwarm.npy', 'gist_rainbow_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_rainbow_r.npy', 'spring': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/spring.npy', 'autumn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/autumn.npy', 'spectral': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/spectral.npy', 'hot_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/hot_r.npy', 'coolwarm_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/coolwarm_r.npy', 'schwarzwald': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/schwarzwald.npy', 'tab10_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab10_r.npy', 'speed_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/speed_r.npy', 'ylgn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylgn_r.npy', 'gnuplot_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnuplot_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', 'rdylbu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdylbu.npy', 'orrd_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/orrd_r.npy', 'piyg_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/piyg_r.npy', 'balance': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/balance.npy', 'balance_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/balance_r.npy', 'pubu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pubu.npy', 'pink': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pink.npy', 'prgn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/prgn_r.npy', 'inferno': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/inferno.npy', 'bupu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bupu.npy', 'dark2_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/dark2_r.npy', 'deep_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/deep_r.npy', 'matter': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/matter.npy', 'jet': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/jet.npy', 'tab20c_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20c_r.npy', 'diff_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/diff_r.npy', 'nipy_spectral': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/nipy_spectral.npy', 'gist_earth_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_earth_r.npy', 'gist_stern_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_stern_r.npy', 'haline': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/haline.npy', 'turbo_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/turbo_r.npy', 'prism': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/prism.npy', 'purd_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/purd_r.npy', 'haline_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/haline_r.npy', 'rplumbo': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rplumbo.npy', 'gist_gray': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_gray.npy', 'greens_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/greens_r.npy', 'gray': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gray.npy', 'algae': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/algae.npy', 'tab10': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab10.npy', 'hsv_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/hsv_r.npy', 'autumn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/autumn_r.npy', 'rdpu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdpu.npy', 'thermal_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/thermal_r.npy', 'oxy': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/oxy.npy', 'cmrmap_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cmrmap_r.npy', 'cubehelix': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cubehelix.npy', 'ylgnbu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylgnbu_r.npy', 'dense': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/dense.npy', 'bugn_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bugn_r.npy', 'gist_stern': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_stern.npy', 'tab20': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20.npy', 'ylorbr': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylorbr.npy', 'summer': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/summer.npy', 'rdylgn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdylgn.npy', 'tab20b_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20b_r.npy', 'jet_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/jet_r.npy', 'paired_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/paired_r.npy', 'dark2': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/dark2.npy', 'binary': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/binary.npy', 'twilight_shifted': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/twilight_shifted.npy', 'seismic': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/seismic.npy', 'pubugn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pubugn.npy', 'ylgn': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylgn.npy', 'rdbu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdbu.npy', 'bone': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bone.npy', 'tab20c': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/tab20c.npy', 'dense_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/dense_r.npy', 'gnbu': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnbu.npy', 'set2': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set2.npy', 'paired': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/paired.npy', 'gnbu_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gnbu_r.npy', 'copper_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/copper_r.npy', 'gist_yarg_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_yarg_r.npy', 'pastel1': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/pastel1.npy', 'bwr_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bwr_r.npy', 'greys': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/greys.npy', 'puor': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/puor.npy', 'oranges_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/oranges_r.npy', 'cool_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cool_r.npy', 'afmhot_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/afmhot_r.npy', 'rdgy_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rdgy_r.npy', 'bone_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/bone_r.npy', 'thermal': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/thermal.npy', 'ice': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ice.npy', 'gray_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gray_r.npy', 'copper': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/copper.npy', 'cfastie': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/cfastie.npy', 'curl_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/curl_r.npy', 'reds': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/reds.npy', 'brg': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/brg.npy', 'solar': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/solar.npy', 'ylorrd_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/ylorrd_r.npy', 'magma': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/magma.npy', 'plasma': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/plasma.npy', 'set3_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set3_r.npy', 'rainbow': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/rainbow.npy', 'terrain': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/terrain.npy', 'gist_gray_r': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/gist_gray_r.npy', 'set1': '/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/rio_tiler/cmap_data/set1.npy'}),
    router: fastapi.routing.APIRouter = <factory>
)

Colormap endpoints Factory.

Class variables

supported_colormaps

Methods

url_for

def url_for(
    self,
    request: starlette.requests.Request,
    name: str,
    **path_params: Any
) -> str

Return full url (with prefix) for a specific endpoint.

FactoryExtension

class FactoryExtension(

)

Factory Extension.

Methods

register

def register(
    self,
    factory: 'BaseTilerFactory'
)

Register extension to the factory.

MultiBandTilerFactory

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 0x7f6c7333bce0>,
    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 0x7f6c69ab4c20>,
    rescale_dependency: Callable[..., Optional[List[Tuple[float, ...]]]] = <function RescalingParams at 0x7f6c69ddae80>,
    color_formula_dependency: Callable[..., Optional[str]] = <function ColorFormulaParams at 0x7f6c69df5a80>,
    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 0x7f6c73f436a0>,
    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 0x7f6c69ab4cc0>,
    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 0x7f6c6a211d10>,
    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

Ancestors (in MRO)

  • titiler.core.factory.TilerFactory
  • titiler.core.factory.BaseTilerFactory

Class variables

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

Methods

add_route_dependencies

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.

bounds

def bounds(
    self
)

Register /bounds endpoint.

color_formula_dependency

def color_formula_dependency(
    color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
) -> Optional[str]

ColorFormula Parameter.

colormap_dependency

def colormap_dependency(
    colormap_name: Annotated[Literal['plasma_r', 'pastel2', 'rdylbu_r', 'cividis', 'purples_r', 'twilight_shifted_r', 'brbg_r', 'gist_ncar_r', 'tarn', 'set1_r', 'rainbow_r', 'bupu_r', 'turbid', 'diff', 'turbid_r', 'ice_r', 'ocean', 'accent_r', 'hot', 'reds_r', 'rdylgn_r', 'gist_yarg', 'hsv', 'nipy_spectral_r', 'greens', 'inferno_r', 'ylgnbu', 'prism_r', 'winter', 'set2_r', 'gnuplot2', 'gnuplot2_r', 'set3', 'speed', 'seismic_r', 'cool', 'bwr', 'purples', 'topo_r', 'spring_r', 'blues', 'rdpu_r', 'terrain_r', 'pastel2_r', 'brg_r', 'rain_r', 'binary_r', 'gist_heat', 'tarn_r', 'amp_r', 'topo', 'prgn', 'phase_r', 'gist_ncar', 'blues_r', 'delta_r', 'tab20_r', 'delta', 'solar_r', 'summer_r', 'oranges', 'tempo', 'spectral_r', 'gist_earth', 'gnuplot', 'piyg', 'viridis', 'orrd', 'cubehelix_r', 'phase', 'magma_r', 'viridis_r', 'twilight_r', 'wistia', 'curl', 'cividis_r', 'tab20b', 'gist_rainbow', 'winter_r', 'pastel1_r', 'flag_r', 'ocean_r', 'bugn', 'rdgy', 'rain', 'algae_r', 'wistia_r', 'accent', 'tempo_r', 'afmhot', 'amp', 'rdbu_r', 'puor_r', 'ylorrd', 'pubu_r', 'brbg', 'pink_r', 'greys_r', 'pubugn_r', 'cmrmap', 'flag', 'turbo', 'oxy_r', 'ylorbr_r', 'matter_r', 'twilight', 'deep', 'purd', 'coolwarm', 'gist_rainbow_r', 'spring', 'autumn', 'spectral', 'hot_r', 'coolwarm_r', 'schwarzwald', 'tab10_r', 'speed_r', 'ylgn_r', 'gnuplot_r', 'gist_heat_r', 'rdylbu', 'orrd_r', 'piyg_r', 'balance', 'balance_r', 'pubu', 'pink', 'prgn_r', 'inferno', 'bupu', 'dark2_r', 'deep_r', 'matter', 'jet', 'tab20c_r', 'diff_r', 'nipy_spectral', 'gist_earth_r', 'gist_stern_r', 'haline', 'turbo_r', 'prism', 'purd_r', 'haline_r', 'rplumbo', 'gist_gray', 'greens_r', 'gray', 'algae', 'tab10', 'hsv_r', 'autumn_r', 'rdpu', 'thermal_r', 'oxy', 'cmrmap_r', 'cubehelix', 'ylgnbu_r', 'dense', 'bugn_r', 'gist_stern', 'tab20', 'ylorbr', 'summer', 'rdylgn', 'tab20b_r', 'jet_r', 'paired_r', 'dark2', 'binary', 'twilight_shifted', 'seismic', 'pubugn', 'ylgn', 'rdbu', 'bone', 'tab20c', 'dense_r', 'gnbu', 'set2', 'paired', 'gnbu_r', 'copper_r', 'gist_yarg_r', 'pastel1', 'bwr_r', 'greys', 'puor', 'oranges_r', 'cool_r', 'afmhot_r', 'rdgy_r', 'bone_r', 'thermal', 'ice', 'gray_r', 'copper', 'cfastie', 'curl_r', 'reds', 'brg', 'solar', 'ylorrd_r', 'magma', 'plasma', 'set3_r', 'rainbow', 'terrain', 'gist_gray_r', 'set1'], Query(PydanticUndefined)] = None,
    colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
)

environment_dependency

def environment_dependency(

)

info

def info(
    self
)

Register /info endpoint.

map_viewer

def map_viewer(
    self
)

Register /map endpoint.

part

def part(
    self
)

Register /bbox and /feature endpoints.

path_dependency

def path_dependency(
    url: typing.Annotated[str, Query(PydanticUndefined)]
) -> str

Create dataset path from args

point

def point(
    self
)

Register /point endpoints.

preview

def preview(
    self
)

Register /preview endpoint.

process_dependency

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.

register_routes

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.

rescale_dependency

def rescale_dependency(
    rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
) -> Optional[List[Tuple[float, ...]]]

Min/Max data Rescaling

statistics

def statistics(
    self
)

add statistics endpoints.

tile

def tile(
    self
)

Register /tiles endpoint.

tilejson

def tilejson(
    self
)

Register /tilejson.json endpoint.

url_for

def url_for(
    self,
    request: starlette.requests.Request,
    name: str,
    **path_params: Any
) -> str

Return full url (with prefix) for a specific endpoint.

wmts

def wmts(
    self
)

Register /wmts endpoint.

MultiBaseTilerFactory

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 0x7f6c7333bce0>,
    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 0x7f6c69ab4c20>,
    rescale_dependency: Callable[..., Optional[List[Tuple[float, ...]]]] = <function RescalingParams at 0x7f6c69ddae80>,
    color_formula_dependency: Callable[..., Optional[str]] = <function ColorFormulaParams at 0x7f6c69df5a80>,
    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 0x7f6c73f436a0>,
    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 0x7f6c69ab4cc0>,
    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 0x7f6c6a211d10>,
    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.

Ancestors (in MRO)

  • titiler.core.factory.TilerFactory
  • titiler.core.factory.BaseTilerFactory

Class variables

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

Methods

add_route_dependencies

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.

bounds

def bounds(
    self
)

Register /bounds endpoint.

color_formula_dependency

def color_formula_dependency(
    color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
) -> Optional[str]

ColorFormula Parameter.

colormap_dependency

def colormap_dependency(
    colormap_name: Annotated[Literal['plasma_r', 'pastel2', 'rdylbu_r', 'cividis', 'purples_r', 'twilight_shifted_r', 'brbg_r', 'gist_ncar_r', 'tarn', 'set1_r', 'rainbow_r', 'bupu_r', 'turbid', 'diff', 'turbid_r', 'ice_r', 'ocean', 'accent_r', 'hot', 'reds_r', 'rdylgn_r', 'gist_yarg', 'hsv', 'nipy_spectral_r', 'greens', 'inferno_r', 'ylgnbu', 'prism_r', 'winter', 'set2_r', 'gnuplot2', 'gnuplot2_r', 'set3', 'speed', 'seismic_r', 'cool', 'bwr', 'purples', 'topo_r', 'spring_r', 'blues', 'rdpu_r', 'terrain_r', 'pastel2_r', 'brg_r', 'rain_r', 'binary_r', 'gist_heat', 'tarn_r', 'amp_r', 'topo', 'prgn', 'phase_r', 'gist_ncar', 'blues_r', 'delta_r', 'tab20_r', 'delta', 'solar_r', 'summer_r', 'oranges', 'tempo', 'spectral_r', 'gist_earth', 'gnuplot', 'piyg', 'viridis', 'orrd', 'cubehelix_r', 'phase', 'magma_r', 'viridis_r', 'twilight_r', 'wistia', 'curl', 'cividis_r', 'tab20b', 'gist_rainbow', 'winter_r', 'pastel1_r', 'flag_r', 'ocean_r', 'bugn', 'rdgy', 'rain', 'algae_r', 'wistia_r', 'accent', 'tempo_r', 'afmhot', 'amp', 'rdbu_r', 'puor_r', 'ylorrd', 'pubu_r', 'brbg', 'pink_r', 'greys_r', 'pubugn_r', 'cmrmap', 'flag', 'turbo', 'oxy_r', 'ylorbr_r', 'matter_r', 'twilight', 'deep', 'purd', 'coolwarm', 'gist_rainbow_r', 'spring', 'autumn', 'spectral', 'hot_r', 'coolwarm_r', 'schwarzwald', 'tab10_r', 'speed_r', 'ylgn_r', 'gnuplot_r', 'gist_heat_r', 'rdylbu', 'orrd_r', 'piyg_r', 'balance', 'balance_r', 'pubu', 'pink', 'prgn_r', 'inferno', 'bupu', 'dark2_r', 'deep_r', 'matter', 'jet', 'tab20c_r', 'diff_r', 'nipy_spectral', 'gist_earth_r', 'gist_stern_r', 'haline', 'turbo_r', 'prism', 'purd_r', 'haline_r', 'rplumbo', 'gist_gray', 'greens_r', 'gray', 'algae', 'tab10', 'hsv_r', 'autumn_r', 'rdpu', 'thermal_r', 'oxy', 'cmrmap_r', 'cubehelix', 'ylgnbu_r', 'dense', 'bugn_r', 'gist_stern', 'tab20', 'ylorbr', 'summer', 'rdylgn', 'tab20b_r', 'jet_r', 'paired_r', 'dark2', 'binary', 'twilight_shifted', 'seismic', 'pubugn', 'ylgn', 'rdbu', 'bone', 'tab20c', 'dense_r', 'gnbu', 'set2', 'paired', 'gnbu_r', 'copper_r', 'gist_yarg_r', 'pastel1', 'bwr_r', 'greys', 'puor', 'oranges_r', 'cool_r', 'afmhot_r', 'rdgy_r', 'bone_r', 'thermal', 'ice', 'gray_r', 'copper', 'cfastie', 'curl_r', 'reds', 'brg', 'solar', 'ylorrd_r', 'magma', 'plasma', 'set3_r', 'rainbow', 'terrain', 'gist_gray_r', 'set1'], Query(PydanticUndefined)] = None,
    colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
)

environment_dependency

def environment_dependency(

)

info

def info(
    self
)

Register /info endpoint.

map_viewer

def map_viewer(
    self
)

Register /map endpoint.

part

def part(
    self
)

Register /bbox and /feature endpoints.

path_dependency

def path_dependency(
    url: typing.Annotated[str, Query(PydanticUndefined)]
) -> str

Create dataset path from args

point

def point(
    self
)

Register /point endpoints.

preview

def preview(
    self
)

Register /preview endpoint.

process_dependency

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.

register_routes

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.

rescale_dependency

def rescale_dependency(
    rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
) -> Optional[List[Tuple[float, ...]]]

Min/Max data Rescaling

statistics

def statistics(
    self
)

Register /statistics endpoint.

tile

def tile(
    self
)

Register /tiles endpoint.

tilejson

def tilejson(
    self
)

Register /tilejson.json endpoint.

url_for

def url_for(
    self,
    request: starlette.requests.Request,
    name: str,
    **path_params: Any
) -> str

Return full url (with prefix) for a specific endpoint.

wmts

def wmts(
    self
)

Register /wmts endpoint.

TMSFactory

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.

Class variables

router_prefix
supported_tms

Methods

register_routes

def register_routes(
    self
)

Register TMS endpoint routes.

url_for

def url_for(
    self,
    request: starlette.requests.Request,
    name: str,
    **path_params: Any
) -> str

Return full url (with prefix) for a specific endpoint.

TilerFactory

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 0x7f6c7333bce0>,
    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 0x7f6c69ab4c20>,
    rescale_dependency: Callable[..., Optional[List[Tuple[float, ...]]]] = <function RescalingParams at 0x7f6c69ddae80>,
    color_formula_dependency: Callable[..., Optional[str]] = <function ColorFormulaParams at 0x7f6c69df5a80>,
    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 0x7f6c73f436a0>,
    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 0x7f6c69ab4cc0>,
    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 0x7f6c6a211d10>,
    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.

Attributes

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

Ancestors (in MRO)

  • titiler.core.factory.BaseTilerFactory

Descendants

  • titiler.core.factory.MultiBaseTilerFactory
  • titiler.core.factory.MultiBandTilerFactory

Class variables

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

Methods

add_route_dependencies

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.

bounds

def bounds(
    self
)

Register /bounds endpoint.

color_formula_dependency

def color_formula_dependency(
    color_formula: Annotated[Optional[str], Query(PydanticUndefined)] = None
) -> Optional[str]

ColorFormula Parameter.

colormap_dependency

def colormap_dependency(
    colormap_name: Annotated[Literal['plasma_r', 'pastel2', 'rdylbu_r', 'cividis', 'purples_r', 'twilight_shifted_r', 'brbg_r', 'gist_ncar_r', 'tarn', 'set1_r', 'rainbow_r', 'bupu_r', 'turbid', 'diff', 'turbid_r', 'ice_r', 'ocean', 'accent_r', 'hot', 'reds_r', 'rdylgn_r', 'gist_yarg', 'hsv', 'nipy_spectral_r', 'greens', 'inferno_r', 'ylgnbu', 'prism_r', 'winter', 'set2_r', 'gnuplot2', 'gnuplot2_r', 'set3', 'speed', 'seismic_r', 'cool', 'bwr', 'purples', 'topo_r', 'spring_r', 'blues', 'rdpu_r', 'terrain_r', 'pastel2_r', 'brg_r', 'rain_r', 'binary_r', 'gist_heat', 'tarn_r', 'amp_r', 'topo', 'prgn', 'phase_r', 'gist_ncar', 'blues_r', 'delta_r', 'tab20_r', 'delta', 'solar_r', 'summer_r', 'oranges', 'tempo', 'spectral_r', 'gist_earth', 'gnuplot', 'piyg', 'viridis', 'orrd', 'cubehelix_r', 'phase', 'magma_r', 'viridis_r', 'twilight_r', 'wistia', 'curl', 'cividis_r', 'tab20b', 'gist_rainbow', 'winter_r', 'pastel1_r', 'flag_r', 'ocean_r', 'bugn', 'rdgy', 'rain', 'algae_r', 'wistia_r', 'accent', 'tempo_r', 'afmhot', 'amp', 'rdbu_r', 'puor_r', 'ylorrd', 'pubu_r', 'brbg', 'pink_r', 'greys_r', 'pubugn_r', 'cmrmap', 'flag', 'turbo', 'oxy_r', 'ylorbr_r', 'matter_r', 'twilight', 'deep', 'purd', 'coolwarm', 'gist_rainbow_r', 'spring', 'autumn', 'spectral', 'hot_r', 'coolwarm_r', 'schwarzwald', 'tab10_r', 'speed_r', 'ylgn_r', 'gnuplot_r', 'gist_heat_r', 'rdylbu', 'orrd_r', 'piyg_r', 'balance', 'balance_r', 'pubu', 'pink', 'prgn_r', 'inferno', 'bupu', 'dark2_r', 'deep_r', 'matter', 'jet', 'tab20c_r', 'diff_r', 'nipy_spectral', 'gist_earth_r', 'gist_stern_r', 'haline', 'turbo_r', 'prism', 'purd_r', 'haline_r', 'rplumbo', 'gist_gray', 'greens_r', 'gray', 'algae', 'tab10', 'hsv_r', 'autumn_r', 'rdpu', 'thermal_r', 'oxy', 'cmrmap_r', 'cubehelix', 'ylgnbu_r', 'dense', 'bugn_r', 'gist_stern', 'tab20', 'ylorbr', 'summer', 'rdylgn', 'tab20b_r', 'jet_r', 'paired_r', 'dark2', 'binary', 'twilight_shifted', 'seismic', 'pubugn', 'ylgn', 'rdbu', 'bone', 'tab20c', 'dense_r', 'gnbu', 'set2', 'paired', 'gnbu_r', 'copper_r', 'gist_yarg_r', 'pastel1', 'bwr_r', 'greys', 'puor', 'oranges_r', 'cool_r', 'afmhot_r', 'rdgy_r', 'bone_r', 'thermal', 'ice', 'gray_r', 'copper', 'cfastie', 'curl_r', 'reds', 'brg', 'solar', 'ylorrd_r', 'magma', 'plasma', 'set3_r', 'rainbow', 'terrain', 'gist_gray_r', 'set1'], Query(PydanticUndefined)] = None,
    colormap: Annotated[Optional[str], Query(PydanticUndefined)] = None
)

environment_dependency

def environment_dependency(

)

info

def info(
    self
)

Register /info endpoint.

map_viewer

def map_viewer(
    self
)

Register /map endpoint.

part

def part(
    self
)

Register /bbox and /feature endpoints.

path_dependency

def path_dependency(
    url: typing.Annotated[str, Query(PydanticUndefined)]
) -> str

Create dataset path from args

point

def point(
    self
)

Register /point endpoints.

preview

def preview(
    self
)

Register /preview endpoint.

process_dependency

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.

register_routes

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.

rescale_dependency

def rescale_dependency(
    rescale: Annotated[Optional[List[str]], Query(PydanticUndefined)] = None
) -> Optional[List[Tuple[float, ...]]]

Min/Max data Rescaling

statistics

def statistics(
    self
)

add statistics endpoints.

tile

def tile(
    self
)

Register /tiles endpoint.

tilejson

def tilejson(
    self
)

Register /tilejson.json endpoint.

url_for

def url_for(
    self,
    request: starlette.requests.Request,
    name: str,
    **path_params: Any
) -> str

Return full url (with prefix) for a specific endpoint.

wmts

def wmts(
    self
)

Register /wmts endpoint.