-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat: STAC Render Extension support #1038
base: main
Are you sure you want to change the base?
feat: STAC Render Extension support #1038
Conversation
Render extension started during STAC render sprint in SatSummit Lisbon 2024. - listing (or showing to please Vincent) Please contribute to complete the feature to - generate the final XYZ link for rendering following the rules in STAC extensions - add a dedicated endpoint for render XYZ
@@ -122,6 +123,7 @@ def validate_access_token(access_token: str = Security(api_key_query)): | |||
router_prefix="/stac", | |||
extensions=[ | |||
stacViewerExtension(), | |||
renderExtension(), |
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.
I think we should rename it stacRenderExtension
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.
I submitted it 3 minutes ago, how are you so fast? 🙃
Makes perfect sense, I will rename it
color_formula: Optional[str] = None | ||
resampling: Optional[str] = None | ||
expression: Optional[str] = None | ||
minmax_zoom: Optional[Annotated[List[int], 2]] = None |
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.
I think you might want to allow more keys event if they are not supported directly by titiler
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.
I took the list of keys from the extension specification here: https://github.com/stac-extensions/render/tree/65edf9bcc7dfe0a02e0191a277c1ac81d86b698e?tab=readme-ov-file#render-object
We can allow the model to validate clearly defined fields but allow extra fields to be read from the render object in STAC and returned by the endpoint. This way we are not overly restrictive but still maintain a defined standard. What do you think?
with factory.reader(src_path) as src: | ||
renders = src.item.properties.get("renders", {}) | ||
pprint(renders) | ||
return renders |
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.
I would maybe return a response in form of
{
"{renderId}": {
"params": {render info},
"links": [
{
"rel": "self",
"title": "{renderId}",
"type": "application/json",
"templated": true,
"href": "/renders/{renderId} href"
},
{
"title": "{renderId} tilejson",
"type": "application/json",
"templated": true,
"href": "titiler tilejson href"
},
{
"title": "{renderId} wmtsa",
"type": "application/json",
"templated": true,
"href": "titiler wmts href"
},
]
},
"links": [
{
"rel": "self",
"type": "application/json",
"href": "https://titiler.api/renders"
},
],
}
Latest changes:
Both are based on item-steninel2.json
Request:
For the |
What I am changing
How I did it
/renders/
lists all renders/renders/<render_id>
returns a specific render with its metadata and template links totilejson.json
andWMTS
How you can test it
Related Issues
Example responses
Those are generated based on this STAC item
Request:
http://127.0.0.1:8000/stac/renders/sir?url=https%3A%2F%2Fraw.githubusercontent.com%2Fstac-extensions%2Frender%2F65edf9bcc7dfe0a02e0191a277c1ac81d86b698e%2Fexamples%2Fitem-sentinel2.json
Response:
Request:
http://127.0.0.1:8000/stac/renders?url=https%3A%2F%2Fraw.githubusercontent.com%2Fstac-extensions%2Frender%2F65edf9bcc7dfe0a02e0191a277c1ac81d86b698e%2Fexamples%2Fitem-sentinel2.json
Response: