Skip to content

Module timvt.factory

timvt.endpoints.factory: router factories.

Variables

TILE_RESPONSE_PARAMS
templates

Functions

queryparams_to_kwargs

def queryparams_to_kwargs(
    q: starlette.datastructures.QueryParams,
    ignore_keys: List = []
) -> Dict

Convert query params to dict.

Classes

TMSFactory

class TMSFactory(
    supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/NZTM2000.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/WGS1984Quad.json'), 'WebMercatorQuad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/WebMercatorQuad.json'), 'WorldCRS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/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.

VectorTilerFactory

class VectorTilerFactory(
    router: fastapi.routing.APIRouter = <factory>,
    supported_tms: morecantile.defaults.TileMatrixSets = TileMatrixSets(tms={'CanadianNAD83_LCC': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/CanadianNAD83_LCC.json'), 'EuropeanETRS89_LAEAQuad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/EuropeanETRS89_LAEAQuad.json'), 'LINZAntarticaMapTilegrid': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/LINZAntarticaMapTilegrid.json'), 'NZTM2000': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/NZTM2000.json'), 'NZTM2000Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/NZTM2000Quad.json'), 'UPSAntarcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/UPSAntarcticWGS84Quad.json'), 'UPSArcticWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/UPSArcticWGS84Quad.json'), 'UTM31WGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/UTM31WGS84Quad.json'), 'WGS1984Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/WGS1984Quad.json'), 'WebMercatorQuad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/WebMercatorQuad.json'), 'WorldCRS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/WorldCRS84Quad.json'), 'WorldMercatorWGS84Quad': PosixPath('/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/morecantile/data/WorldMercatorWGS84Quad.json')}),
    default_tms: str = 'WebMercatorQuad',
    layer_dependency: Callable[..., timvt.layer.Layer] = <function LayerParams at 0x7fb2f59d9280>,
    with_tables_metadata: bool = False,
    with_functions_metadata: bool = False,
    with_viewer: bool = False,
    router_prefix: str = ''
)

VectorTiler Factory.

Class variables

default_tms
router_prefix
supported_tms
with_functions_metadata
with_tables_metadata
with_viewer

Methods

layer_dependency

def layer_dependency(
    request: starlette.requests.Request,
    layer: str = Path(Ellipsis)
) -> timvt.layer.Layer

Return Layer Object.

register_functions_metadata

def register_functions_metadata(
    self
)

Register function metadata endpoints.

register_routes

def register_routes(
    self
)

Register Routes.

register_tables_metadata

def register_tables_metadata(
    self
)

Register metadata endpoints.

register_tiles

def register_tiles(
    self
)

Register /tiles endpoints.

register_viewer

def register_viewer(
    self
)

Register viewer.

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.