Skip to content

Module titiler.mosaic.factory

TiTiler.mosaic Router factories.

None

Variables

MAX_THREADS
img_endpoint_params

Functions

PixelSelectionParams

def PixelSelectionParams(
    pixel_selection: titiler.mosaic.resources.enums.PixelSelectionMethod = Query(first)
) -> rio_tiler.mosaic.methods.base.MosaicMethodBase

Returns the mosaic method used to combine datasets together.

Classes

MosaicTilerFactory

class MosaicTilerFactory(
    reader: Type[cogeo_mosaic.backends.base.BaseBackend] = <function MosaicBackend at 0x7f735d26f550>,
    router: fastapi.routing.APIRouter = <factory>,
    path_dependency: Callable[..., Any] = <function DatasetPathParams at 0x7f735ca55790>,
    dataset_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DatasetParams'>,
    layer_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.BidxExprParams'>,
    render_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.ImageRenderingParams'>,
    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 ColorMapParams at 0x7f735cbc39d0>,
    stats_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.StatisticsParams'>,
    histogram_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.HistogramParams'>,
    process_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.PostProcessParams'>,
    tms_dependency: Callable[..., morecantile.models.TileMatrixSet] = <function WebMercatorTMSParams at 0x7f735cbc3790>,
    reader_dependency: Type[titiler.core.dependencies.DefaultDependency] = <class 'titiler.core.dependencies.DefaultDependency'>,
    environment_dependency: Callable[..., Dict] = <function BaseTilerFactory.<lambda> at 0x7f73651ed550>,
    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>,
    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.cogeo.COGReader'>,
    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 0x7f735d26f430>
)

Ancestors (in MRO)

  • titiler.core.factory.BaseTilerFactory

Class variables

backend_dependency
dataset_dependency
dataset_reader
histogram_dependency
layer_dependency
process_dependency
reader_dependency
render_dependency
router_prefix
stats_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.

assets

def assets(
    self
)

Register /assets endpoint.

bounds

def bounds(
    self
)

Register /bounds endpoint.

colormap_dependency

def colormap_dependency(
    colormap_name: titiler.core.dependencies.ColorMapName = Query(None),
    colormap: str = Query(None)
) -> Union[Dict[int, Tuple[int, int, int, int]], Sequence[Tuple[Tuple[Union[float, int], Union[float, int]], Tuple[int, int, int, int]]], NoneType]

Colormap Dependency.

environment_dependency

def environment_dependency(

)

info

def info(
    self
)

Register /info endpoint

path_dependency

def path_dependency(
    url: str = Query(Ellipsis)
) -> str

Create dataset path from args

pixel_selection_dependency

def pixel_selection_dependency(
    pixel_selection: titiler.mosaic.resources.enums.PixelSelectionMethod = Query(first)
) -> rio_tiler.mosaic.methods.base.MosaicMethodBase

Returns the mosaic method used to combine datasets together.

point

def point(
    self
)

Register /point endpoint.

read

def read(
    self
)

Register / (Get) Read endpoint.

reader

def reader(
    input: str,
    *args: Any,
    **kwargs: Any
) -> cogeo_mosaic.backends.base.BaseBackend

Select mosaic backend for input.

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.

tile

def tile(
    self
)

Register /tiles endpoints.

tilejson

def tilejson(
    self
)

Add tilejson endpoint.

tms_dependency

def tms_dependency(
    TileMatrixSetId: titiler.core.dependencies.WebMercatorTileMatrixSetName = Query(WebMercatorTileMatrixSetName.WebMercatorQuad)
) -> morecantile.models.TileMatrixSet

TileMatrixSet Dependency.

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.

validate

def validate(
    self
)

Register /validate endpoint.

wmts

def wmts(
    self
)

Add wmts endpoint.