GeoTIFF / georaster-layer-for-leaflet

Display GeoTIFFs and soon other types of raster on your Leaflet Map
https://geotiff.github.io/georaster-layer-for-leaflet-example/
Apache License 2.0
297 stars 58 forks source link

Shifted tiles #77

Open vlach1989 opened 3 years ago

vlach1989 commented 3 years ago

The edge between tiles is visible, as if they were slightly offset from each other.

Both in Chrome 93 and Firefox 91 and evident in almost all examples,

image

m-mohr commented 3 years ago

Yes, I can confirm this issue:

grafik

Here it looks even worse.

DanielJDufour commented 3 years ago

Yup. Confirming this issue, too. I'm working on an improved version of this library, by intergrading with geowarp, which provides access to more resampling algorithms. Hopefully, things will render better once that work is complete.

jcphill commented 3 years ago

This issue only seems to affect rasters loaded from a URL. Loading from an array buffer looks fine.

jcphill commented 3 years ago

I think this is fixed by https://github.com/jcphill/georaster-layer-for-leaflet/commit/2996308f1c7ed66cf0dc2fc37ac23d0d01a8baf8

jcphill commented 3 years ago

I think this is fixed by jcphill@2996308

That's only a partial fix. Most of the edge shifting is due to how COG sampling interacts with axis rotation in projections.

m-mohr commented 2 years ago

@DanielJDufour Is this a bug that has been "recently" introduced? I think the images looked better some versions ago so I'm wondering where this is coming from. Some files look really weird...

DanielJDufour commented 2 years ago

@m-mohr , I believe there were issues with Planet's Hurricane Harvey COGs' tiles lining up before the recent refactors. Would you be able to provide any other GeoTIFFs that are looking weird and I can take a look? I definitely agree it's an issue and I'll do my best to fix it :-)

drwelby commented 2 years ago

Seeing this with our COGs that are UTM like https://dg-opendata.s3.amazonaws.com/texas-tornadoes22/pre/14/120200003332/2018-11-13/103001008748E600-visual.tif

I can fit in some time to help if you can point me towards next steps.

glaroc commented 1 year ago

We are having this issue with some of our COGs that are not in EPSG:4326 or 3857 as well.

jmlord commented 1 year ago

Hi, to put images on @glaroc said (I'm working with him), the overlap is especially visible when zoomed out at continent level. image

Here is the tiff: https://drive.google.com/file/d/1R9lTcgvHrlPyUEjidEvhvp8PqBvV8B9j/view?usp=sharing

In our case as well, the bug became visible when we moved from a downloaded tiff to a remote COG.

Our current workaround is to use TiTiler as an intermediate to insert the raster as a TileLayer instead. If a fix comes to this issue I would happily drop the workaround.

DanielJDufour commented 1 year ago

Hi, @glaroc and @jmlord . I'm working on a fix and should have something up in a few weeks. Would it be okay with you if I added the "overlapping tiles" tiff that you linked to as a test case? Thanks and hope you have a great weekend!

jmlord commented 1 year ago

That is great news! Yes, you can use it for a test case. Have a nice weekend too ;)

DanielJDufour commented 1 year ago

Hi, all. Just wanted to give an update. I have this fixed this on my laptop now. It'll still probably be a few weeks before I clean up the code and make sure there aren't any regressions. However, if you need this urgently, let me know and I can probably push a branch up to Github that'll work in most use cases.

jmlord commented 1 year ago

Thanks! We are aiming towards a deployment late spring, so we can use the workaround in the meantime. If you want us to test a branch before you release it, let us know.

glaroc commented 1 year ago

@DanielJDufour Hi, are there any updates on this ? I'd be happy to test this on a branch as well.

jmlord commented 1 year ago

Hi @DanielJDufour, can we test your fix on some branch? Merci!

DanielJDufour commented 1 year ago

Hi, all. I'm sorry for delay and late update. I just wanted to mention that I am still working on this. I uncovered some other issues that I also need to fix with the new branch.

jmlord commented 1 year ago

Hi, all. I'm sorry for delay and late update. I just wanted to mention that I am still working on this. I uncovered some other issues that I also need to fix with the new branch.

Ok, thanks for letting us know.

DanielJDufour commented 1 year ago

Hi, all. I wanted to give a quick status update. Basically, I'm still working on it.

I'm focusing on delivering a newer version of georaster-layer-for-leaflet with the current version of georaster. Not waiting for the next version of georaster (which has been in the works forever). I'm basically just refactoring 90% of the codebase to make use of geowarp, geotiff-tile and geotiff-tile-web-worker. Hopefully the resulting code will be a lot simpler and cleaner in addition to faster and more accurate.

I'm sorry for how long this is taking

DanielJDufour commented 1 year ago

But there is cause for optimism, the technical approach has been validated and the rendering algorithms are already complete via geotiff-tile and geowarp . It's mostly just putting in the long hours refactoring code and catching regressions that's required.

Paddy-Farmeye commented 9 months ago

Hi @DanielJDufour, any further update?

DanielJDufour commented 8 months ago

Hi, @Paddy-Farmeye . This should be fixed for the majority of situations in the current release candidate. You can test it by installing georaster-layer-for-leaflet@next. Could you let me know if it fixes it for you?

I'd like to have more people testing the new version before I officially release it.

(Exceptions that aren't supported yet are files that aren't in a standard projection or files that have a custom geotransform or rotation applied)

DanielJDufour commented 8 months ago

Hi, all. I wanted to give an update that I just published a new pre-release version of georaster-layer-for-leaflet that adds a lot more support for displaying in non-web mercator projections via proj4leaflet (even supports EPSG:3031!)

This is likely the penultimate pre-release before the next major version of GeoRasterLayer for Leaflet. If you have time, I would love any feedback you might have.

staffordsmith83 commented 8 months ago

One thing - to get it working in our application I had to configure webpack to use the non-minified version as I think the minified version has a some 'Unexpected token' non ES5 compatible stuff - more feedback soon!

staffordsmith83 commented 8 months ago

One thing - to get it working in our application I had to configure webpack to use the non-minified version as I think the minified version has a some 'Unexpected token' non ES5 compatible stuff - more feedback soon!

Sorry about this we have a very complex build pipeline at the moment and getting lots of errors on our part - sorry its taking time to test! Initial glipses are that the tile misalignment is solved, but performance is a bit slower, I think as expected

Paddy-Farmeye commented 8 months ago

Hi, @Paddy-Farmeye . This should be fixed for the majority of situations in the current release candidate. You can test it by installing georaster-layer-for-leaflet@next. Could you let me know if it fixes it for you?

I'd like to have more people testing the new version before I officially release it.

(Exceptions that aren't supported yet are files that aren't in a standard projection or files that have a custom geotransform or rotation applied)

Hi @DanielJDufour, at first glance it does seem to be a good deal smoother and the tiles are matching up better than before.