geotrellis
geotrellis copied to clipboard
Non-empty result from `RasterExtent.gridBoundsFor` for non-intersecting Extent
I'd expect the call to isEmpty below to be true when asking for the GridBounds of an Extent outside the area of a RasterExtent:
import geotrellis.raster.RasterExtent
import geotrellis.vector._
val extent = Extent(0, 0, 10, 10)
val re = RasterExtent(extent, 100, 100)
// Create something outside the original extent
val target = extent.translate(300, 300)
val bounds = re.gridBoundsFor(target, clamp = true)
println(bounds.isEmpty)
println(bounds)
println(target.intersects(re.extent))
...
> false // <-- would expect this to be true
> GridBounds(99,0,99,0) // <-- not sure what this should be.... some sentinel value like GridBounds(-1, -1, -1, -1)?
> false