locationtech / geotrellis

GeoTrellis is a geographic data processing engine for high performance applications.
http://geotrellis.io
Other
1.33k stars 360 forks source link

Incorrect Pyramid levels when using LocalLayoutScheme #3414

Open jdries opened 3 years ago

jdries commented 3 years ago

Describe the bug

When creating a Pyramid that uses 'LocalLayoutScheme', for an RDD where the extent is not nicely aligned to the LayoutDefinition, lower zoom levels are corrupt.

Example screenshot

(Those white vertical strips are not supposed to be there)

image

To Reproduce

I experienced this with this code: https://github.com/Open-EO/openeo-geotrellis-extensions/blob/b38029ac83e671e70ff85b15e055d6f696c11641/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/geotiff/package.scala#L179 Reproducing it in a unit test was more difficult, because the RDDs in my tests are too well aligned.

I personally solved it by using a custom layout scheme, which simply multiplies the cellsize with a factor 2, which aligns better with halving tile sizes: https://github.com/Open-EO/openeo-geotrellis-extensions/blob/f3fcb0ec13aa6048773aea283aa1eb14c8a0791e/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/geotiff/package.scala#L174

This may also be better behavior for the LocalLayoutScheme included in Geotrellis?

Expected behavior

Correct overviews

Environment