Skip to content

Instantly share code, notes, and snippets.

@vincentsarago
Last active June 28, 2024 15:43
Show Gist options
  • Save vincentsarago/670be0fb8926f6b1f8dfe0b1e3efdd7d to your computer and use it in GitHub Desktop.
Save vincentsarago/670be0fb8926f6b1f8dfe0b1e3efdd7d to your computer and use it in GitHub Desktop.
# /collections/{collection_id}/time/{date}/tiles/{tileMatrixSetId}/{x}/{y}/{z}.png
def DatasetPathParams(
collection_id: Annotated[str, Path(description="collection_id")],
time_dimension: Annotated[str, Path(description="date", alias="date")],
) -> str:
""""Here you can use collection_id and time_dimension to get the COG url."""
...
app = FastAPI()
tiler = TilerFactory(
path_dependency=DatasetPathParams,
router_prefix="/collections/{collection_id}/time/{date}",
)
app.include_router(
tiler.router,
prefix="/collections/{collection_id}/time/{date}",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment