Module titiler.core.factory¶
TiTiler Router factories.
Variables¶
DEFAULT_TEMPLATES
WGS84_CRS
img_endpoint_params
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 0x7fac9caea160>,
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[..., Union[titiler.core.algorithm.base.BaseAlgorithm, NoneType]] = <function Algorithms.dependency.<locals>.post_process at 0x7fac96f37c10>,
rescale_dependency: Callable[..., Union[List[Tuple[float, ...]], NoneType]] = <function RescalingParams at 0x7fac9c76c280>,
color_formula_dependency: Callable[..., Union[str, NoneType]] = <function ColorFormulaParams at 0x7fac971bb430>,
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 0x7faca0fef160>,
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 0x7fac96f37f70>,
supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/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.8.18/x64/lib/python3.8/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
default_tms: str = 'WebMercatorQuad',
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 0x7fac9714e460>
)
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: typing_extensions.Annotated[Union[str, NoneType], Query(PydanticUndefined)] = None
) -> Union[str, NoneType]
ColorFormula Parameter.
colormap_dependency¶
def colormap_dependency(
colormap_name: typing_extensions.Annotated[Literal['coolwarm', 'plasma_r', 'brbg_r', 'tab20c', 'phase_r', 'turbid_r', 'pastel1', 'matter_r', 'bone', 'oranges', 'solar_r', 'ylgnbu', 'gnuplot2', 'dark2', 'diff', 'ylorrd', 'schwarzwald', 'purd', 'purd_r', 'set3', 'phase', 'set1_r', 'afmhot', 'twilight_shifted', 'tab20c_r', 'greens_r', 'tab10_r', 'cool_r', 'greys', 'rdbu_r', 'ylgnbu_r', 'puor_r', 'matter', 'pubugn', 'gist_rainbow', 'amp', 'jet', 'wistia_r', 'curl', 'tempo', 'spring_r', 'autumn_r', 'rplumbo', 'thermal_r', 'jet_r', 'pastel2', 'inferno_r', 'gist_heat_r', 'ice_r', 'haline_r', 'rdbu', 'solar', 'copper_r', 'puor', 'hsv_r', 'copper', 'topo_r', 'turbo', 'seismic_r', 'reds_r', 'gnuplot2_r', 'summer_r', 'spectral_r', 'rainbow', 'rdylgn', 'oxy_r', 'gist_ncar_r', 'prism', 'set1', 'prgn_r', 'tab20', 'pubugn_r', 'pastel2_r', 'gist_stern_r', 'viridis_r', 'twilight_r', 'pink_r', 'cividis_r', 'deep', 'tab20b_r', 'algae_r', 'accent', 'gnuplot_r', 'gist_stern', 'dense', 'twilight_shifted_r', 'spectral', 'ice', 'amp_r', 'purples', 'flag_r', 'prism_r', 'afmhot_r', 'paired', 'gist_gray_r', 'winter', 'rdgy_r', 'bupu_r', 'greens', 'cmrmap', 'prgn', 'orrd', 'gist_earth', 'dark2_r', 'gist_rainbow_r', 'nipy_spectral', 'deep_r', 'oranges_r', 'cubehelix', 'topo', 'gist_yarg', 'ylorbr_r', 'binary_r', 'gray_r', 'binary', 'purples_r', 'hot', 'gnbu', 'set2', 'bugn_r', 'tab20_r', 'algae', 'rdpu_r', 'rainbow_r', 'ylorrd_r', 'plasma', 'set3_r', 'piyg_r', 'rdylbu', 'seismic', 'gray', 'cfastie', 'gist_ncar', 'balance_r', 'rdylgn_r', 'gist_earth_r', 'tarn', 'inferno', 'gnuplot', 'ocean', 'coolwarm_r', 'blues_r', 'paired_r', 'turbo_r', 'oxy', 'ylorbr', 'bwr_r', 'viridis', 'orrd_r', 'pubu', 'twilight', 'ylgn_r', 'rain_r', 'nipy_spectral_r', 'delta', 'rdylbu_r', 'pastel1_r', 'summer', 'rain', 'diff_r', 'brg_r', 'cmrmap_r', 'brbg', 'terrain_r', 'gist_heat', 'hot_r', 'blues', 'bupu', 'curl_r', 'bugn', 'magma', 'flag', 'cividis', 'terrain', 'bwr', 'balance', 'hsv', 'spring', 'greys_r', 'pink', 'cool', 'speed', 'wistia', 'brg', 'delta_r', 'ocean_r', 'cubehelix_r', 'gist_yarg_r', 'tarn_r', 'haline', 'accent_r', 'gnbu_r', 'tempo_r', 'tab10', 'ylgn', 'reds', 'autumn', 'magma_r', 'speed_r', 'pubu_r', 'tab20b', 'set2_r', 'piyg', 'turbid', 'rdpu', 'bone_r', 'gist_gray', 'thermal', 'rdgy', 'dense_r', 'winter_r'], Query(PydanticUndefined)] = None,
colormap: typing_extensions.Annotated[Union[str, NoneType], Query(PydanticUndefined)] = None
)
environment_dependency¶
def environment_dependency(
)
path_dependency¶
def path_dependency(
url: typing_extensions.Annotated[str, Query(PydanticUndefined)]
) -> str
Create dataset path from args
process_dependency¶
def process_dependency(
algorithm: typing_extensions.Annotated[Literal['hillshade', 'contours', 'normalizedIndex', 'terrarium', 'terrainrgb'], Query(PydanticUndefined)] = None,
algorithm_params: typing_extensions.Annotated[Union[str, NoneType], Query(PydanticUndefined)] = None
) -> Union[titiler.core.algorithm.base.BaseAlgorithm, NoneType]
Data Post-Processing options.
register_routes¶
def register_routes(
self
)
Register Tiler Routes.
rescale_dependency¶
def rescale_dependency(
rescale: typing_extensions.Annotated[Union[List[str], NoneType], Query(PydanticUndefined)] = None
) -> Union[List[Tuple[float, ...]], NoneType]
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.
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 0x7fac9caea160>,
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[..., Union[titiler.core.algorithm.base.BaseAlgorithm, NoneType]] = <function Algorithms.dependency.<locals>.post_process at 0x7fac96f37c10>,
rescale_dependency: Callable[..., Union[List[Tuple[float, ...]], NoneType]] = <function RescalingParams at 0x7fac9c76c280>,
color_formula_dependency: Callable[..., Union[str, NoneType]] = <function ColorFormulaParams at 0x7fac971bb430>,
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 0x7faca0fef160>,
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 0x7fac96f37f70>,
supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/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.8.18/x64/lib/python3.8/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
default_tms: str = 'WebMercatorQuad',
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 0x7fac9714e460>,
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: typing_extensions.Annotated[Union[str, NoneType], Query(PydanticUndefined)] = None
) -> Union[str, NoneType]
ColorFormula Parameter.
colormap_dependency¶
def colormap_dependency(
colormap_name: typing_extensions.Annotated[Literal['coolwarm', 'plasma_r', 'brbg_r', 'tab20c', 'phase_r', 'turbid_r', 'pastel1', 'matter_r', 'bone', 'oranges', 'solar_r', 'ylgnbu', 'gnuplot2', 'dark2', 'diff', 'ylorrd', 'schwarzwald', 'purd', 'purd_r', 'set3', 'phase', 'set1_r', 'afmhot', 'twilight_shifted', 'tab20c_r', 'greens_r', 'tab10_r', 'cool_r', 'greys', 'rdbu_r', 'ylgnbu_r', 'puor_r', 'matter', 'pubugn', 'gist_rainbow', 'amp', 'jet', 'wistia_r', 'curl', 'tempo', 'spring_r', 'autumn_r', 'rplumbo', 'thermal_r', 'jet_r', 'pastel2', 'inferno_r', 'gist_heat_r', 'ice_r', 'haline_r', 'rdbu', 'solar', 'copper_r', 'puor', 'hsv_r', 'copper', 'topo_r', 'turbo', 'seismic_r', 'reds_r', 'gnuplot2_r', 'summer_r', 'spectral_r', 'rainbow', 'rdylgn', 'oxy_r', 'gist_ncar_r', 'prism', 'set1', 'prgn_r', 'tab20', 'pubugn_r', 'pastel2_r', 'gist_stern_r', 'viridis_r', 'twilight_r', 'pink_r', 'cividis_r', 'deep', 'tab20b_r', 'algae_r', 'accent', 'gnuplot_r', 'gist_stern', 'dense', 'twilight_shifted_r', 'spectral', 'ice', 'amp_r', 'purples', 'flag_r', 'prism_r', 'afmhot_r', 'paired', 'gist_gray_r', 'winter', 'rdgy_r', 'bupu_r', 'greens', 'cmrmap', 'prgn', 'orrd', 'gist_earth', 'dark2_r', 'gist_rainbow_r', 'nipy_spectral', 'deep_r', 'oranges_r', 'cubehelix', 'topo', 'gist_yarg', 'ylorbr_r', 'binary_r', 'gray_r', 'binary', 'purples_r', 'hot', 'gnbu', 'set2', 'bugn_r', 'tab20_r', 'algae', 'rdpu_r', 'rainbow_r', 'ylorrd_r', 'plasma', 'set3_r', 'piyg_r', 'rdylbu', 'seismic', 'gray', 'cfastie', 'gist_ncar', 'balance_r', 'rdylgn_r', 'gist_earth_r', 'tarn', 'inferno', 'gnuplot', 'ocean', 'coolwarm_r', 'blues_r', 'paired_r', 'turbo_r', 'oxy', 'ylorbr', 'bwr_r', 'viridis', 'orrd_r', 'pubu', 'twilight', 'ylgn_r', 'rain_r', 'nipy_spectral_r', 'delta', 'rdylbu_r', 'pastel1_r', 'summer', 'rain', 'diff_r', 'brg_r', 'cmrmap_r', 'brbg', 'terrain_r', 'gist_heat', 'hot_r', 'blues', 'bupu', 'curl_r', 'bugn', 'magma', 'flag', 'cividis', 'terrain', 'bwr', 'balance', 'hsv', 'spring', 'greys_r', 'pink', 'cool', 'speed', 'wistia', 'brg', 'delta_r', 'ocean_r', 'cubehelix_r', 'gist_yarg_r', 'tarn_r', 'haline', 'accent_r', 'gnbu_r', 'tempo_r', 'tab10', 'ylgn', 'reds', 'autumn', 'magma_r', 'speed_r', 'pubu_r', 'tab20b', 'set2_r', 'piyg', 'turbid', 'rdpu', 'bone_r', 'gist_gray', 'thermal', 'rdgy', 'dense_r', 'winter_r'], Query(PydanticUndefined)] = None,
colormap: typing_extensions.Annotated[Union[str, NoneType], 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_extensions.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: typing_extensions.Annotated[Literal['hillshade', 'contours', 'normalizedIndex', 'terrarium', 'terrainrgb'], Query(PydanticUndefined)] = None,
algorithm_params: typing_extensions.Annotated[Union[str, NoneType], Query(PydanticUndefined)] = None
) -> Union[titiler.core.algorithm.base.BaseAlgorithm, NoneType]
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: typing_extensions.Annotated[Union[List[str], NoneType], Query(PydanticUndefined)] = None
) -> Union[List[Tuple[float, ...]], NoneType]
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 0x7fac9caea160>,
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[..., Union[titiler.core.algorithm.base.BaseAlgorithm, NoneType]] = <function Algorithms.dependency.<locals>.post_process at 0x7fac96f37c10>,
rescale_dependency: Callable[..., Union[List[Tuple[float, ...]], NoneType]] = <function RescalingParams at 0x7fac9c76c280>,
color_formula_dependency: Callable[..., Union[str, NoneType]] = <function ColorFormulaParams at 0x7fac971bb430>,
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 0x7faca0fef160>,
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 0x7fac96f37f70>,
supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/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.8.18/x64/lib/python3.8/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
default_tms: str = 'WebMercatorQuad',
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 0x7fac9714e460>,
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: typing_extensions.Annotated[Union[str, NoneType], Query(PydanticUndefined)] = None
) -> Union[str, NoneType]
ColorFormula Parameter.
colormap_dependency¶
def colormap_dependency(
colormap_name: typing_extensions.Annotated[Literal['coolwarm', 'plasma_r', 'brbg_r', 'tab20c', 'phase_r', 'turbid_r', 'pastel1', 'matter_r', 'bone', 'oranges', 'solar_r', 'ylgnbu', 'gnuplot2', 'dark2', 'diff', 'ylorrd', 'schwarzwald', 'purd', 'purd_r', 'set3', 'phase', 'set1_r', 'afmhot', 'twilight_shifted', 'tab20c_r', 'greens_r', 'tab10_r', 'cool_r', 'greys', 'rdbu_r', 'ylgnbu_r', 'puor_r', 'matter', 'pubugn', 'gist_rainbow', 'amp', 'jet', 'wistia_r', 'curl', 'tempo', 'spring_r', 'autumn_r', 'rplumbo', 'thermal_r', 'jet_r', 'pastel2', 'inferno_r', 'gist_heat_r', 'ice_r', 'haline_r', 'rdbu', 'solar', 'copper_r', 'puor', 'hsv_r', 'copper', 'topo_r', 'turbo', 'seismic_r', 'reds_r', 'gnuplot2_r', 'summer_r', 'spectral_r', 'rainbow', 'rdylgn', 'oxy_r', 'gist_ncar_r', 'prism', 'set1', 'prgn_r', 'tab20', 'pubugn_r', 'pastel2_r', 'gist_stern_r', 'viridis_r', 'twilight_r', 'pink_r', 'cividis_r', 'deep', 'tab20b_r', 'algae_r', 'accent', 'gnuplot_r', 'gist_stern', 'dense', 'twilight_shifted_r', 'spectral', 'ice', 'amp_r', 'purples', 'flag_r', 'prism_r', 'afmhot_r', 'paired', 'gist_gray_r', 'winter', 'rdgy_r', 'bupu_r', 'greens', 'cmrmap', 'prgn', 'orrd', 'gist_earth', 'dark2_r', 'gist_rainbow_r', 'nipy_spectral', 'deep_r', 'oranges_r', 'cubehelix', 'topo', 'gist_yarg', 'ylorbr_r', 'binary_r', 'gray_r', 'binary', 'purples_r', 'hot', 'gnbu', 'set2', 'bugn_r', 'tab20_r', 'algae', 'rdpu_r', 'rainbow_r', 'ylorrd_r', 'plasma', 'set3_r', 'piyg_r', 'rdylbu', 'seismic', 'gray', 'cfastie', 'gist_ncar', 'balance_r', 'rdylgn_r', 'gist_earth_r', 'tarn', 'inferno', 'gnuplot', 'ocean', 'coolwarm_r', 'blues_r', 'paired_r', 'turbo_r', 'oxy', 'ylorbr', 'bwr_r', 'viridis', 'orrd_r', 'pubu', 'twilight', 'ylgn_r', 'rain_r', 'nipy_spectral_r', 'delta', 'rdylbu_r', 'pastel1_r', 'summer', 'rain', 'diff_r', 'brg_r', 'cmrmap_r', 'brbg', 'terrain_r', 'gist_heat', 'hot_r', 'blues', 'bupu', 'curl_r', 'bugn', 'magma', 'flag', 'cividis', 'terrain', 'bwr', 'balance', 'hsv', 'spring', 'greys_r', 'pink', 'cool', 'speed', 'wistia', 'brg', 'delta_r', 'ocean_r', 'cubehelix_r', 'gist_yarg_r', 'tarn_r', 'haline', 'accent_r', 'gnbu_r', 'tempo_r', 'tab10', 'ylgn', 'reds', 'autumn', 'magma_r', 'speed_r', 'pubu_r', 'tab20b', 'set2_r', 'piyg', 'turbid', 'rdpu', 'bone_r', 'gist_gray', 'thermal', 'rdgy', 'dense_r', 'winter_r'], Query(PydanticUndefined)] = None,
colormap: typing_extensions.Annotated[Union[str, NoneType], 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_extensions.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: typing_extensions.Annotated[Literal['hillshade', 'contours', 'normalizedIndex', 'terrarium', 'terrainrgb'], Query(PydanticUndefined)] = None,
algorithm_params: typing_extensions.Annotated[Union[str, NoneType], Query(PydanticUndefined)] = None
) -> Union[titiler.core.algorithm.base.BaseAlgorithm, NoneType]
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: typing_extensions.Annotated[Union[List[str], NoneType], Query(PydanticUndefined)] = None
) -> Union[List[Tuple[float, ...]], NoneType]
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.8.18/x64/lib/python3.8/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/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.8.18/x64/lib/python3.8/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/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 0x7fac9caea160>,
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[..., Union[titiler.core.algorithm.base.BaseAlgorithm, NoneType]] = <function Algorithms.dependency.<locals>.post_process at 0x7fac96f37c10>,
rescale_dependency: Callable[..., Union[List[Tuple[float, ...]], NoneType]] = <function RescalingParams at 0x7fac9c76c280>,
color_formula_dependency: Callable[..., Union[str, NoneType]] = <function ColorFormulaParams at 0x7fac971bb430>,
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 0x7faca0fef160>,
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 0x7fac96f37f70>,
supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CDB1GlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/CDB1GlobalGrid.json'), 'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'GNOSISGlobalGrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/GNOSISGlobalGrid.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/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.8.18/x64/lib/python3.8/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
default_tms: str = 'WebMercatorQuad',
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 0x7fac9714e460>,
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: typing_extensions.Annotated[Union[str, NoneType], Query(PydanticUndefined)] = None
) -> Union[str, NoneType]
ColorFormula Parameter.
colormap_dependency¶
def colormap_dependency(
colormap_name: typing_extensions.Annotated[Literal['coolwarm', 'plasma_r', 'brbg_r', 'tab20c', 'phase_r', 'turbid_r', 'pastel1', 'matter_r', 'bone', 'oranges', 'solar_r', 'ylgnbu', 'gnuplot2', 'dark2', 'diff', 'ylorrd', 'schwarzwald', 'purd', 'purd_r', 'set3', 'phase', 'set1_r', 'afmhot', 'twilight_shifted', 'tab20c_r', 'greens_r', 'tab10_r', 'cool_r', 'greys', 'rdbu_r', 'ylgnbu_r', 'puor_r', 'matter', 'pubugn', 'gist_rainbow', 'amp', 'jet', 'wistia_r', 'curl', 'tempo', 'spring_r', 'autumn_r', 'rplumbo', 'thermal_r', 'jet_r', 'pastel2', 'inferno_r', 'gist_heat_r', 'ice_r', 'haline_r', 'rdbu', 'solar', 'copper_r', 'puor', 'hsv_r', 'copper', 'topo_r', 'turbo', 'seismic_r', 'reds_r', 'gnuplot2_r', 'summer_r', 'spectral_r', 'rainbow', 'rdylgn', 'oxy_r', 'gist_ncar_r', 'prism', 'set1', 'prgn_r', 'tab20', 'pubugn_r', 'pastel2_r', 'gist_stern_r', 'viridis_r', 'twilight_r', 'pink_r', 'cividis_r', 'deep', 'tab20b_r', 'algae_r', 'accent', 'gnuplot_r', 'gist_stern', 'dense', 'twilight_shifted_r', 'spectral', 'ice', 'amp_r', 'purples', 'flag_r', 'prism_r', 'afmhot_r', 'paired', 'gist_gray_r', 'winter', 'rdgy_r', 'bupu_r', 'greens', 'cmrmap', 'prgn', 'orrd', 'gist_earth', 'dark2_r', 'gist_rainbow_r', 'nipy_spectral', 'deep_r', 'oranges_r', 'cubehelix', 'topo', 'gist_yarg', 'ylorbr_r', 'binary_r', 'gray_r', 'binary', 'purples_r', 'hot', 'gnbu', 'set2', 'bugn_r', 'tab20_r', 'algae', 'rdpu_r', 'rainbow_r', 'ylorrd_r', 'plasma', 'set3_r', 'piyg_r', 'rdylbu', 'seismic', 'gray', 'cfastie', 'gist_ncar', 'balance_r', 'rdylgn_r', 'gist_earth_r', 'tarn', 'inferno', 'gnuplot', 'ocean', 'coolwarm_r', 'blues_r', 'paired_r', 'turbo_r', 'oxy', 'ylorbr', 'bwr_r', 'viridis', 'orrd_r', 'pubu', 'twilight', 'ylgn_r', 'rain_r', 'nipy_spectral_r', 'delta', 'rdylbu_r', 'pastel1_r', 'summer', 'rain', 'diff_r', 'brg_r', 'cmrmap_r', 'brbg', 'terrain_r', 'gist_heat', 'hot_r', 'blues', 'bupu', 'curl_r', 'bugn', 'magma', 'flag', 'cividis', 'terrain', 'bwr', 'balance', 'hsv', 'spring', 'greys_r', 'pink', 'cool', 'speed', 'wistia', 'brg', 'delta_r', 'ocean_r', 'cubehelix_r', 'gist_yarg_r', 'tarn_r', 'haline', 'accent_r', 'gnbu_r', 'tempo_r', 'tab10', 'ylgn', 'reds', 'autumn', 'magma_r', 'speed_r', 'pubu_r', 'tab20b', 'set2_r', 'piyg', 'turbid', 'rdpu', 'bone_r', 'gist_gray', 'thermal', 'rdgy', 'dense_r', 'winter_r'], Query(PydanticUndefined)] = None,
colormap: typing_extensions.Annotated[Union[str, NoneType], 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_extensions.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: typing_extensions.Annotated[Literal['hillshade', 'contours', 'normalizedIndex', 'terrarium', 'terrainrgb'], Query(PydanticUndefined)] = None,
algorithm_params: typing_extensions.Annotated[Union[str, NoneType], Query(PydanticUndefined)] = None
) -> Union[titiler.core.algorithm.base.BaseAlgorithm, NoneType]
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: typing_extensions.Annotated[Union[List[str], NoneType], Query(PydanticUndefined)] = None
) -> Union[List[Tuple[float, ...]], NoneType]
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.