* add `pgstac_dependency` attribute in `MosaicTilerFactory` (defaults to `dependencies.PgSTACParams`)
* add database's `pool` check in startup event
* add *metadata layers* links in mosaic's `/info` response for TileJSON, map and wmts endpoint links
* add `CollectionIdParams` dependency to retrieve a SearchId for a CollectionId
* add `/collections/{collection_id}` virtual mosaic endpoints
* update endpoints Tags (`STAC Search`, `STAC Collection`, `STAC Item`)
Endpoint breaking changes
* move PgSTAC Search Virtual Mosaic's endpoints from `/mosaic` to `/searches`
* in `model.RegisterResponse` (model used in `/register` endpoint) rename `searchid` by `id`
python
before
resp = httpx.post("/mosaic/register", body={"collections": ["my-collection"], "filter-lang": "cql-json"})
assert resp.json()["searchid"]
now
resp = httpx.post("/searches/register", body={"collections": ["my-collection"], "filter-lang": "cql-json"})
assert resp.json()["id"]
API breaking changes
* rename `dependencies.PathParams` to `dependencies.SearchIdParams`
* rename `searchid` path parameter to `search_id` in `SearchIdParams`
* move `check_query_params` methods outside `MosaicTilerFactory` class
* make `path_dependency` a required input to `MosaicTilerFactory` class
python
before
app = FastAPI()
mosaic = MosaicTilerFactory(...)
app.include_router(mosaic.router)
now
app = FastAPI()
mosaic = MosaicTilerFactory(
...,
path_dependency=lambda: "aaaaaaaaaaaaaa"
)
app.include_router(mosaic.router)
* remove `/{search_id}` prefix in `MosaicTilerFactory` routes. Now use parameter injection from global prefix
python
Before
app = FastAPI()
mosaic = MosaicTilerFactory(
...,
router_prefix="/mosaics"
)
app.include_router(mosaic.router, prefix="/mosaics")
Now
app = FastAPI()
mosaic = MosaicTilerFactory(
...
router_prefix="/mosaics/{search_id}"
)
app.include_router(mosaic.router, prefix="/mosaics/{search_id}")
* move `/info` endpoint outside the `MosaicTilerFactory` to its own *extension* (`titiler.pgstac.extension.searchInfoExtension`)
python
Before
app = FastAPI()
mosaic = MosaicTilerFactory(...)
app.include_router(mosaic.router)
Now
app = FastAPI()
mosaic = MosaicTilerFactory(
...
extensions=[
searchInfoExtension(),
]
)
app.include_router(mosaic.router)
* move `/register` and `/list` endpoint creation outside the `MosaicTilerFactory` class
python
before
from titiler.pgstac.factory import MosaicTilerFactory
mosaic = MosaicTilerFactory(
...,
router_prefix="/{search_id}",
)
app.include_router(mosaic.router, prefix="/{search_id}")
Now
from titiler.pgstac.factory import (
MosaicTilerFactory,
add_search_register_route,
add_mosaic_register_route,
)
mosaic = MosaicTilerFactory(
...,
router_prefix="/{search_id}",
)
app.include_router(mosaic.router, prefix="/{search_id}")
add /register endpoint
add_search_register_route(
app,
any dependency we want to validate
when creating the tilejson/map links
tile_dependencies=[
mosaic.layer_dependency,
mosaic.dataset_dependency,
mosaic.pixel_selection_dependency,
mosaic.process_dependency,
mosaic.rescale_dependency,
mosaic.colormap_dependency,
mosaic.render_dependency,
mosaic.pgstac_dependency,
mosaic.reader_dependency,
mosaic.backend_dependency,
],
)
add /list endpoint
add_search_list_route(app)