- 
                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
| 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)
| validators=[ | ||
| FileExtensionValidator( | ||
| allowed_extensions=["tiff", "tif", "geotiff", "gtiff"] | ||
| allowed_extensions=["tiff", "tif", "geotiff", "gtiff", "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.
@willemarcel, could you take a look here and see if this is correct? I thought just adding the vrt extension here and running python manage.py makemigrations + redeploying should work, but the backend is still not accepting .vrt file uploads. Am I missing a step somewhere?
This PR sketch out a simple / custom TiTiler for VBOS