Skip to content

Instantly share code, notes, and snippets.

View vincentsarago's full-sized avatar

Vincent Sarago vincentsarago

View GitHub Profile
@vincentsarago
vincentsarago / app.py
Created January 24, 2025 10:26
Full stac-fastapi Application
import os
from fastapi.responses import ORJSONResponse
from stac_fastapi.api.app import StacApi
from stac_fastapi.api.models import (
EmptyRequest,
ItemCollectionUri,
create_get_request_model,
create_post_request_model,
create_request_model,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
You'll need to download https://github.com/RemotePixel/poster-py/tree/master/poster/assets first
"""
import os
from math import ceil
from typing import Callable, Literal, Optional
from dataclasses import dataclass
# /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."""
...
import os
import json
import click
from rasterio.rio import options
from rio_tiler.io import Reader
import morecantile
@click.command()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.