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

Adjust canvas getData() offsets and rendered gutter for served image size #13609

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mike-000
Copy link
Contributor

@mike-000 mike-000 commented Apr 27, 2022

Fixes #13605 for canvas rendering

Calculate layer.getData() offsets based on the actual image size in case image is scaled to fit specified tile size.

Also fix the rendering so gutter is adjusted for image size. Previously canvas rendering only handled gutter for TileWMS where the image was requested to fit the tile grid. Canvas rendering is now consistent with WebGL rendering applying gutter to scaled textures.

To avoid conflicts a separate commit in #13575 applies the change to WebGL. For WebGL renderer this was fixed by #13648

@github-actions
Copy link

📦 Preview the examples and docs from this branch here: https://deploy-preview-13609--ol-site.netlify.app/.

@ahocevar
Copy link
Member

ahocevar commented May 5, 2022

Wouldn't it simplify things in a lot of places if we handled the corner case of a gutter (which I think no-one really uses, except some very rare cases with WMS tiles) the same way as we handle cropped tiles in the Zoomify source, i.e. by rendering the image we get from the source to a canvas that is a correctly sized tile?

@mike-000
Copy link
Contributor Author

mike-000 commented May 5, 2022

No, gutter is now also available for XYZ (currently we have no examples). When rendering with WebGL without a gutter there are always tile edge effects when interpolating, sometimes quite obvious as below. Mapbox and Nextzen have guttered tiles which avoid that, but to work the gutter must be clipped during rendering

image

image

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

Successfully merging this pull request may close these issues.

layer.getData() returns incorrect result if image is scaled to fit tile size
2 participants