Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added stac endpoint and stac cog extension #16

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
permissions:
contents: read
packages: write


steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -33,17 +31,6 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# - name: Copy .env file
# run: cp "gdal_rio.env" gdal_rio.env

# - name: Read gdal_rio.env file and set environment variables
# run: |
# while IFS= read -r line;
# do
# export $(echo "$line" | grep -v '^#' | xargs)
# done < gdal_rio.env


- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand Down
25 changes: 23 additions & 2 deletions src/cogserver/server.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
from titiler.application import main as default
from cogserver.dependencies import SignedDatasetPath
from rio_tiler.io import STACReader
import logging
from fastapi import FastAPI
from titiler.core.factory import TilerFactory, MultiBandTilerFactory
from titiler.core.factory import TilerFactory, MultiBandTilerFactory, MultiBaseTilerFactory
from titiler.application import __version__ as titiler_version
from cogserver.landing import setup_landing
from starlette.middleware.cors import CORSMiddleware
from titiler.mosaic.factory import MosaicTilerFactory
from titiler.core.errors import DEFAULT_STATUS_CODES, add_exception_handlers
from titiler.mosaic.errors import MOSAIC_STATUS_CODES
from titiler.extensions.stac import stacExtension

logging.basicConfig()
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -46,7 +48,7 @@
extensions=[
# cogValidateExtension(),
# cogViewerExtension(),
# stacExtension(),
stacExtension(),
],
path_dependency=SignedDatasetPath
)
Expand All @@ -68,6 +70,25 @@

###############################################################################

############################# STAC #######################################
# STAC endpoints
if not api_settings.disable_stac:
stac = MultiBaseTilerFactory(
reader=STACReader,
router_prefix="/stac",
extensions=[
#stacViewerExtension(),
],
path_dependency=SignedDatasetPath,
)

app.include_router(
stac.router, prefix="/stac", tags=["SpatioTemporal Asset Catalog"]
)

###############################################################################


############################# MultiBand #######################################


Expand Down