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

Skip completed tile indices in makeTiles() #1167

Closed
graymartin opened this issue May 23, 2023 · 2 comments
Closed

Skip completed tile indices in makeTiles() #1167

graymartin opened this issue May 23, 2023 · 2 comments

Comments

@graymartin
Copy link

I am currently working on a project where I am taking a large stack of high-resolution rasters and saving the stack to a network share for distributed computation. I've tried using makeTiles() for this purpose and it is working extremely well. However, I did think of a potential quality-of-life improvement for the function.

Since writing to the network share can take a long time and has the potential to fail, it would be super helpful to have the ability to skip a certain number of tiles or select specific tile indices to run with this function. That way, I don't lose as much progress if the run fails because of a connection error or some other issue. Alternatively, it would be nice to be able to ignore/skip raster files that are already in the output directory.

I'm not sure how to go about adding this--I am not very experienced with coding in C++ and from what I can tell, makeTiles() calls a C++ function in raster_methods.cpp. If it seems like a good addition and wouldn't be too hard to add, it would be awesome to see this feature in a new version of terra!

@rhijmans
Copy link
Member

Thank you for bringing this up and for your PR. I am proposing a somewhat different approach. With the changes I made, existing tiles are skipped if overwrite=FALSE (the default).

@graymartin
Copy link
Author

Thank you so much! I like this approach a lot and appreciate the help.

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