Skip to content

Conversation

@vincentsarago
Copy link
Member

This PR sketch out a simple / custom TiTiler for VBOS

Screenshot 2025-10-28 at 22 33 32

Comment on lines +73 to +89
###############################################################################
# TiTiler endpoints
def DatasetPathParams(
dataset_id: Annotated[
Literal["coral", "other"],
Path(description="Dataset"),
],
year: Annotated[int, Path(description="Year")],
) -> str:
"""Custom Dataset Path Parameter which define dataset_id and year PATH parameter and return a VRT url."""
name: str
if dataset_id == "coral":
name = "nbgi_clipped"
elif dataset_id == "other":
raise HTTPException(status_code=404, detail="Not Found.")

return f"https://syd1.digitaloceanspaces.com/mis-geotiff-storage/production/raster/{name}_{year}.vrt"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

This part needs to be updated once we have the VRT created

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vincentsarago, I've uploaded a sample VRT now, it's at https://syd1.digitaloceanspaces.com/mis-geotiff-storage/production/raster/nbgi_clipped_2024.vrt. Use &rescale=-0.3,0.3 to scale to visible values. Feel free to test things and lemme know if any changes are needed.

Cc @lillythomas who will be uploading the VRTs for the other years.

templates=titiler_templates,
router_prefix="/dataset/{dataset_id}/years/{year}",
)
app.include_router(tiler.router, prefix="/dataset/{dataset_id}/years/{year}")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small titiler hack, we use a special notation for the endpoint prefix /dataset/{dataset_id}/years/{year}. This will tell FastAPI to look for Path parameters (define in our custom DatasetPathParams)

@vincentsarago vincentsarago changed the title sketch custom tiler [DO NOT MERGE] sketch custom tiler Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants