geotrellis icon indicating copy to clipboard operation
geotrellis copied to clipboard

"Conceptual port" of GDALSuggestedWarpOutput2 looks to be missing some GDAL behavior

Open moradology opened this issue 6 years ago • 0 comments

The strategy we use in ReprojectRasterExtent https://github.com/locationtech/geotrellis/blob/a463c48e7470e4ecfc0ae0ac297133d8bd00d641/raster/src/main/scala/geotrellis/raster/reproject/ReprojectRasterExtent.scala#L46-L73, which purports to be a 'conceptual port' of GDALSuggestedWarpOutput2 https://gdal.org/doxygen/gdal__alg_8h.html#a8ae26881b86e42ff958a8e81c4976fb3, is very possibly wasteful and less accurate than the method which inspires it. It appears as though GDAL chooses a few random points along the sides of an image, reprojects those points (it also tests for bijective projection - and warps just the bijectively transformable portion if the randomly selected points fail said test), and then measures the distance from the top left point to the bottom right point (post transformation) to establish the distance which must be evenly divided among cells

moradology avatar Jul 30 '19 21:07 moradology