Skip to content

Is there a way to crop by image coordinates? #428

Answered by vincentsarago
rbudhu asked this question in Q&A
Discussion options

You must be logged in to vote

👋 @rbudhu

Good question! No there is not but here is how you could add one:

from fastapi import FastAPI, Path, Query, Depends

from titiler.core.factory import TilerFactory, img_endpoint_params
from titiler.core.utils import Timer
from titiler.core.resources.enums import ImageType

from rasterio import windows


app = FastAPI(description="A lightweight Cloud Optimized GeoTIFF tile server")

# Create a Default set of endpoint using the TilerFactory
cog = TilerFactory()

# Register a custom `/window` endpoint
@cog.router.get(
    # https://rasterio.readthedocs.io/en/latest/topics/windowed-rw.html?highlight=window#windows
    # simple path parameters to define a rasterio window
    r"/window…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rbudhu
Comment options

Answer selected by vincentsarago
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants