matteason / live-cloud-maps

Near real-time cloud maps
Creative Commons Zero v1.0 Universal
207 stars 5 forks source link

Visible seam at antimeridian #2

Closed matteason closed 7 months ago

matteason commented 7 months ago

There's a visible seam at the antimeridian where the source data doesn't quite reach the edges of the image. This is quite prominent when the image is wrapped round a sphere.

Over the poles we take a mirror image of the area below combined with a fade to solid white to compensate for missing data. Doing something similar here would probably only make the seam more obvious, so I'll need to do something smarter to infill the missing data. Need to ensure that the left edge is contiguous with the right edge so that it loops seamlessly.

matteason commented 7 months ago

Possible solution: take the first valid pixel on the left and last valid pixel on the right of each row, then create a smooth gradient between them, towards the edges, by interpolating them.

matteason commented 7 months ago

I've now implemented a fix for this. The gap is filled in by creating a gradient in the gap between the values of the pixels either side of the gap.

Before Rendering of the earth with a small white seam between the north and south poles

After The same image of the earth without a seam

This isn't perfect, and can create a 'smearing' effect in some areas: Close-up of last image showing some smearing in cloud details

...but I think it's a big improvement particularly at lower zoom levels. If anyone has any ideas on improving this I'd be really grateful.