Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

return metadata in the response headers #994

Open
vincentsarago opened this issue Oct 3, 2024 · 0 comments
Open

return metadata in the response headers #994

vincentsarago opened this issue Oct 3, 2024 · 0 comments

Comments

@vincentsarago
Copy link
Member

content, media_type = render_image(
image,
output_format=format,
colormap=colormap or dst_colormap,
**render_params.as_dict(),
)
return Response(content, media_type=media_type)

It could be useful for the client application to get metadata from the response, in some endpoints:

  • /preview - bounding box, image min/max, crs (might be tricky but we can restrict to epsg number)
  • /tiles - image min/max

for mosaic we already have an optional x_assets header, we could add x_assets_number...

headers: Dict[str, str] = {}
if OptionalHeader.x_assets in self.optional_headers:
headers["X-Assets"] = ",".join(assets)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant