This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import abc | |
from dataclasses import asdict, dataclass | |
from typing import Dict, Optional, Sequence, Union | |
import affine | |
from rasterio.crs import CRS | |
from rasterio.io import MemoryFile | |
from rio_cogeo.cogeo import cog_translate | |
from rio_cogeo.profiles import JPEGProfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Callable | |
from fastapi import FastAPI, APIRouter | |
from starlette.middleware.base import BaseHTTPMiddleware | |
from starlette.requests import Request | |
from starlette.routing import Match | |
app = FastAPI() | |
router = APIRouter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import abc | |
from dataclasses import dataclass | |
from io import BytesIO | |
from typing import Tuple | |
import numpy as np | |
from cogeo_mosaic.backends import MosaicBackend | |
from rio_tiler.errors import TileOutsideBounds | |
from rio_tiler.mosaic import mosaic_reader |