Rasters.jl icon indicating copy to clipboard operation
Rasters.jl copied to clipboard

use StepRange rather than LinRange

Open rafaqz opened this issue 2 years ago • 1 comments
trafficstars

Fixes #427

@biskwikman your example works for me on this branch, you can check it out with ] add Rasters#fix_lookup_accuracy if you would like to give it a try.

rafaqz avatar Apr 21 '23 17:04 rafaqz

Note: using step range is generally safer but has the small chance of complete failure even to load a raster if the length of the range is wrong due to floating point error.

Its not clear what kind of error is preferable, but not even loading a raster seems worse

rafaqz avatar Jun 28 '23 13:06 rafaqz

Further note: this will work if we use StepRangeLen, which didn't exist when Rasters.jl started but you get from range(; start, stop, length)

rafaqz avatar Oct 09 '24 12:10 rafaqz