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

COG skewed at lower zoom levels #114

Open
Tommatheussen opened this issue Nov 28, 2022 · 1 comment
Open

COG skewed at lower zoom levels #114

Tommatheussen opened this issue Nov 28, 2022 · 1 comment

Comments

@Tommatheussen
Copy link

Tommatheussen commented Nov 28, 2022

Describe the bug
COGs are skewed at lower zoom levels. This only happens when the data gets loaded directly using the URL. Loading the file into an arrayBuffer works correctly, but this obviously defeats the purpose of COGs. (sample code below)

To Reproduce

async addGeoRasterToMap(url: string) {
  /* Option that works */
  let arrayBuffer = await fetch(url)
    .then(response => response.arrayBuffer());

  let georaster: GeoRaster = await parseGeoRaster(arrayBuffer);

  /* Option that does not work correctly */
  let georaster: GeoRaster = await parseGeoRaster(url);

  const layer = new GeoRasterLayer({
    georaster: georaster,
  })

  this._leafletMap.addLayer(layer);
}

Expected behavior
A clear and concise description of what you expected to happen.
Screenshots

Lower zoom level shows skewed result:
image

Higher zoom levels gradually get increasingly more accurate:
image

Same data using arrayBuffer:
image

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Firefox
  • Version 107.0

Additional context
I can provide the used geotiff file, although it seems to happen on all geotiff files I currently have available to me.
Looks like the problem is that the COG files use EPSG:4326 projection and leaflet is using EPSG:3857

@jcphill
Copy link
Contributor

jcphill commented Jul 25, 2023

This is likely a duplicate of #77.

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

2 participants