GeoTIFF/georaster-layer-for-leaflet

Tiles misaligned when source raster not in native projection

staffordsmith83 opened this issue · 1 comments

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!

This is likely a duplicate of #77.