openlayers / openlayers

OpenLayers
https://openlayers.org
BSD 2-Clause "Simplified" License
11.42k stars 3.03k forks source link

After interpolate is set to true, there are still curved teeth when loading cogtif #15885

Open heian911 opened 5 months ago

heian911 commented 5 months ago

I am loading cogtif data for display. The property interpolate in new GeoTIFFSource is set to true, which means linear interpolation. It is smooth in some places, but there are still obvious jaggies in some places.

image

image

image

mike-000 commented 5 months ago

If you are reprojecting reproj tiles will by default be produced for each zoom level in the view, so there will be nothing for the WebGL renderer to interpolate. If you restrict the reproj tile grid to an equivalent (taking into account the differences in the projections) maxZoom as the original source the renderer will interpolate when overzooming. Compare the same GeoTIFF in the two maps in https://stackblitz.com/edit/js-wacbe4?file=package.json,index.html,index.js

This could potentially be fixed by #15860 although that does yet work reliably with all COGs. Compare https://openlayers.org/en/latest/examples/stac-item.html with https://deploy-preview-15860--ol-site.netlify.app/en/latest/examples/stac-item.html when zoomed in.