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

For leaflet or ipyleaflet viewers, handle non-square tiles #1789

Open
manthey opened this issue Jan 24, 2025 · 2 comments
Open

For leaflet or ipyleaflet viewers, handle non-square tiles #1789

manthey opened this issue Jan 24, 2025 · 2 comments

Comments

@manthey
Copy link
Member

manthey commented Jan 24, 2025

ipyleaflet doesn't pass through information on non-square tiles and a previous node suggests that they didn't work as expected directly in leaflet anyway. When using non-square tiles in leaflet or ipyleaflet, we could use region requests instead of tile requests.

@manthey
Copy link
Member Author

manthey commented Jan 24, 2025

As a work-around in Jupyter notebooks, instead of source = large_image.open('non-square-tiles.tif'), you can do source = large_image.open({"sources": [{"path": 'non-square-tiles.tif'}], "tileWidth": 256, "tileHeight": 256}).

@manthey
Copy link
Member Author

manthey commented Jan 29, 2025

One way to do this would be to have a getSquareTile method that would take the same parameters as getTile plus a singular size value and would call getRegion with appropriate parameters to actually produce the data. When exposing endpoints, it would be useful to have tiles/:size and tiles/:size/zxy/... endpoints that would return the metadata as if the specified tile size was native and the size tiles. If the size was the native size of the source, it should just redirect to the unsized versions.

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

No branches or pull requests

1 participant