geotrellis icon indicating copy to clipboard operation
geotrellis copied to clipboard

Incorrect Pyramid levels when using LocalLayoutScheme

Open jdries opened this issue 4 years ago • 0 comments

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

  • Java version: 1.8
  • Scala version: 2.11
  • GeoTrellis version: 3.6

jdries avatar Sep 15 '21 11:09 jdries