-
Notifications
You must be signed in to change notification settings - Fork 0
[DO NOT MERGE] sketch custom tiler #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| ############################################################################### | ||
| # 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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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}") |
There was a problem hiding this comment.
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)
This PR sketch out a simple / custom TiTiler for VBOS