COG displayed with native resolution#1563
Open
davidoesch wants to merge 2 commits intogeoadmin:developfrom
Open
COG displayed with native resolution#1563davidoesch wants to merge 2 commits intogeoadmin:developfrom
davidoesch wants to merge 2 commits intogeoadmin:developfrom
Conversation
Disabling interpolation for COG layers: Beacuse we should always show the native resolution, and not interpoalte it. The current WebGLTileLayer does not set the interpolate option. To disable interpolation, modify OpenLayersCOGTiffLayer.vue: You need to also disable interpolation at the source level. The vanilla OL solution : https://codesandbox.io/p/devbox/cog-forked-49q956
OpenLayers View instances are created per projection. To enable constrainResolution: true, lets add it to the LV95 view configuration and to the WebMercator view around line . I assume this is neede to ensure native resolution displayed in the map viewer for COG as ege shown with vanilla OL in https://codesandbox.io/p/devbox/cog-forked-49q956
pakb
reviewed
Feb 2, 2026
Contributor
pakb
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I'm in the process of finishing a huge TypeScript migration, and will be rebasing this and merging it there as soon as I can.
Contributor
Author
|
@pakb you have to test it, I do assume it might work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request improves the rendering of Cloud Optimized GeoTIFF (COG) layers by ensuring that the native pixel resolution is preserved and no interpolation is applied during display.
Current situation https://s.geo.admin.ch/0y1b8b1l5tlq

Proposed solution https://codesandbox.io/p/devbox/cog-forked-49q956

Changes
Disable interpolation for COG layers (WebGLTileLayer)
Interpolation is explicitly disabled to ensure that COG layers are always rendered at their native resolution.
WebGLTileLayerconfiguration does not set theinterpolateoption.OpenLayersCOGTiffLayer.vue.https://codesandbox.io/p/devbox/cog-forked-49q956
This prevents unintended resampling artifacts and ensures pixel-accurate visualization.
Enable
constrainResolutionfor map viewsTo further guarantee native resolution rendering, the
constrainResolution: trueoption is added to the OpenLayersViewconfiguration.Viewinstances are created per projection.Rationale
Both changes are required to ensure that COG layers are displayed consistently and without interpolation, aligning the map viewer behavior with standard OpenLayers COG rendering.