Skip to content

Tiles misaligned when source raster not in native projection #128

@staffordsmith83

Description

@staffordsmith83

Describe the bug
When loading a cog that is in a non-native coordinate system, the cog is displayed in a way that individual tiles do not align well at the edges.

This is example is a public COG hosted at https://dea-public-data.s3.ap-southeast-2.amazonaws.com/derivative/ga_ls_tc_pc_cyear_3/1-0-0/x17/y37/2022--P1Y/ga_ls_tc_pc_cyear_3_x17y37_2022--P1Y_final_wet_pc_50.tif

It is in EPSG:3577

I am reprojecting as per the example code for georaster-layer-for-leaflet

To Reproduce
Steps to reproduce the behavior:

  1. Load https://dea-public-data.s3.ap-southeast-2.amazonaws.com/derivative/ga_ls_tc_pc_cyear_3/1-0-0/x17/y37/2022--P1Y/ga_ls_tc_pc_cyear_3_x17y37_2022--P1Y_final_wet_pc_50.tif as a Georaster layer
  2. See that the tiles do not align

Expected behavior
I would expect the tiles to align at the edges

Screenshots
The cog overlaid on leaflet showing the misalignment:
image

Desktop (please complete the following information):

  • OS: MacOS 13.4
  • Browser: Chrome
  • Version: 114.0.5735.133 (Official Build) (x86_64)

Additional context

If I reproject the cog to EPSG:4326, then the tiles align, so I believe this is due to how data is reprojected on the fly.
I reprojected using command gdalwarp -t_srs EPSG:4326 -dstnodata -9999 ga_ls_tc_pc_cyear_3_x17y37_2022--P1Y_final_wet_pc_50.tif ga_ls_tc_pc_cyear_3_x17y37_2022--P1Y_final_wet_pc_50_4326.tif

I will leave the reprojeted cog file here for testing @DanielJDufour if that is helpful: https://stafs-cogs.s3.ap-southeast-2.amazonaws.com/ga_ls_tc_pc_cyear_3_x17y37_2022--P1Y_final_wet_pc_50_4326.tif

When reprojected to 4326:
image

Thankyou so much @DanielJDufour for the awesome helpful library!

Activity

jcphill

jcphill commented on Jul 25, 2023

@jcphill
Contributor

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Tiles misaligned when source raster not in native projection · Issue #128 · GeoTIFF/georaster-layer-for-leaflet