Skip to content
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

Add a way for users to inject their own links into API responses #191

Open
geospatial-jeff opened this issue Jul 26, 2021 · 1 comment
Open
Labels
api layer enhancement New feature or request

Comments

@geospatial-jeff
Copy link
Collaborator

What's the status of this PR? IMO stac-fastapi shouldn't host its own tiler - the titiler-pgstac is a good example of standing up a tiler that uses STAC but a separate service that can be deployed independently. In our implementation of stac-fastapi, we override the pgstac backend core client in order to iterate over collections/items and inject tiler links where appropriate. I think this approach allows stac-fastapi to concentrate on just the STAC API endpoints, but allows customization by users if they want to add titiler or other tiling capability. I could see work done to generalize and implement a link injection mechanism so that other libraries can write hooks into the STAC objects returned by stac-fastapi so that the link/asset injection logic can live in that external project. But I don't think we should create tilers directly in stac-fastapi.

Originally posted by @lossyrob in #97 (comment)

@duckontheweb
Copy link
Contributor

I could see work done to generalize and implement a link injection mechanism so that other libraries can write hooks into the STAC objects returned by stac-fastapi so that the link/asset injection logic can live in that external project

This would be useful for us. We have some additional endpoints in our the MLHub API that we might want to inject into the landing page links, and I could see it being helpful when we set this up behind a reverse proxy. Having a similar mechanism for asset hrefs would also be useful to us. We replace all asset links with encoded URLs that we then decode in a separate route so that we can track general usage statistics. In our current STAC API, we have to capture the response and replace all of these, but if there were an easier/faster way to do this that would help us out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api layer enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants