Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RasterStack does not load lazily with directory path as argument #469

Closed
tiemvanderdeure opened this issue Jun 28, 2023 · 1 comment · Fixed by #470
Closed

RasterStack does not load lazily with directory path as argument #469

tiemvanderdeure opened this issue Jun 28, 2023 · 1 comment · Fixed by #470

Comments

@tiemvanderdeure
Copy link
Contributor

When loading a RasterStack using the directory path containing the rasters instead of filenames, the Rasters are loaded to disk even when using lazy = true.

An example reproducing this is:

using Rasters, ArchGDAL

r = Raster(rand(100, 100), dims = (X(1:100), Y(1:100)), missingval = NaN)

dir = "mydata"

if ~isdir(dir) mkdir(dir) end

for i in 1:10
    write("$dir/raster_$i.tif", r)
end

stack = RasterStack(dir, lazy = true)

Rasters.isdisk(stack) ## false!

files = ["$dir/raster_$i.tif" for i in 1:10]
stack = RasterStack(files, lazy = true)
Rasters.isdisk(raster1) ## true
@rafaqz
Copy link
Owner

rafaqz commented Jun 28, 2023

Likely the keyword is not propagating somewhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants