Open pomadchin opened 6 years ago
Also probably it would make some sense to have a cropOption
method in addition to an unsafe crop
, instead of reimplementing all current crop
methods.
Seems unlikely to make it into 2.0 this late in the game, but I am partial to defaulting to Option
results if we revisit the API. Yeah, that will force the addition of .get
calls (likely inside a try
/catch
block). But that's a good change if throwing is what you want your program to do - it makes such sites just a little more visible and a little more obvious and it doesn't require us to clutter users' heads with renamed methods that do basically the same thing
Current
crop
function defined for all Raster types returns aT
, instead of returning anOption[T]
type. It causes semantic and logical issues with understanding howcrop
function should behave in case of acrop
call by a not intersecting area. PR https://github.com/locationtech/geotrellis/pull/2684 would standardize crop function exceptions and behaviour, but probably it's not the thing finally we want to achieve.It's unclear do we want to introduce it in terms of
2.0
or not. @echeipesh