Skip to content

Commit

Permalink
add collection endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
smohiudd committed Jul 24, 2024
1 parent 139182e commit 2db7ac6
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions raster_api/runtime/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from titiler.extensions import cogValidateExtension, cogViewerExtension
from titiler.mosaic.errors import MOSAIC_STATUS_CODES
from titiler.pgstac.db import close_db_connection, connect_to_db
from titiler.pgstac.dependencies import SearchIdParams
from titiler.pgstac.dependencies import CollectionIdParams, SearchIdParams
from titiler.pgstac.extensions import searchInfoExtension
from titiler.pgstac.factory import (
MosaicTilerFactory,
Expand Down Expand Up @@ -75,7 +75,7 @@ async def lifespan(app: FastAPI):
add_exception_handlers(app, MOSAIC_STATUS_CODES)

###############################################################################
# /mosaic - PgSTAC Mosaic titiler endpoint
# /searches - PgSTAC Mosaic titiler endpoint
###############################################################################
mosaic = MosaicTilerFactory(
router_prefix="/searches/{search_id}",
Expand Down Expand Up @@ -108,6 +108,24 @@ async def lifespan(app: FastAPI):
# add /list endpoint
add_search_list_route(app, prefix="/searches", tags=["Mosaic"])

###############################################################################
# STAC COLLECTION Endpoints
###############################################################################
collection = MosaicTilerFactory(
path_dependency=CollectionIdParams,
optional_headers=optional_headers,
router_prefix="/collections/{collection_id}",
add_statistics=True,
add_viewer=True,
add_part=True,
extensions=[
searchInfoExtension(),
],
)
app.include_router(
collection.router, tags=["STAC Collection"], prefix="/collections/{collection_id}"
)


###############################################################################
# /stac - Custom STAC titiler endpoint
Expand Down

0 comments on commit 2db7ac6

Please sign in to comment.