geotrellis icon indicating copy to clipboard operation
geotrellis copied to clipboard

Non-empty result from `RasterExtent.gridBoundsFor` for non-intersecting Extent

Open metasim opened this issue 6 years ago • 0 comments

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

metasim avatar Sep 25 '19 19:09 metasim