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

Tiles misaligned when source raster not in native projection #128

Open
staffordsmith83 opened this issue Jun 27, 2023 · 1 comment
Open

Comments

@staffordsmith83
Copy link

staffordsmith83 commented Jun 27, 2023

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!

@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
Projects
None yet
Development

No branches or pull requests

3 participants