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

gb_clear_cache() failure #28

Open
noahdasanaike opened this issue Jan 21, 2024 · 3 comments
Open

gb_clear_cache() failure #28

noahdasanaike opened this issue Jan 21, 2024 · 3 comments
Assignees

Comments

@noahdasanaike
Copy link

Attempting to use gb_clear_cache(force = TRUE) to empty out the download cache, but gb_list_cache() returns an item ("geoBoundaries-CAN-ADM1-all.zip") that seems to persist despite calling the former.

If I try to download the same file (rgeoboundaries::gb_adm1("Canada")), I get the error Error: cannot open vsizip/C:\Users\[name]\AppData\Local/Cache/R/gb_cache/geoBoundaries-CAN-ADM1-all.zip/geoBoundaries-CAN-ADM1.shp"; The file doesn't seem to exist. I am able to download and clear the cache for other countries, so maybe there's some nuance here on my side that would fail to replicate, perhaps it's something about the Canada ADM1 boundaries, or it could be that the gb_clear_cache function does not work for all edge cases.

@noahdasanaike
Copy link
Author

Just wanted to attach another error here:

rgeoboundaries::gb_adm0()
Error: Cannot open "/vsizip//Users/noahdasanaike/Library/Caches/R/gb_cache/geoBoundariesCGAZ_ADM0.zip"; The file doesn't seem to exist.

@dickoa
Copy link
Collaborator

dickoa commented Feb 9, 2024

Hi @noahdasanaike
I'll take a look and revert. Thanks for reporting this issue.
It might be related to the different versions of the data, I'll fix it.

@DanRunfola DanRunfola assigned dickoa and unassigned rohith4444 Feb 12, 2024
@rohith4444
Copy link
Collaborator

Hi @noahdasanaike,

I wanted to inform you that we have recently replaced the cache functionality with a temporary directory approach. This temporary directory is easier to manage and remove, and it should eliminate the need to manually clear the cache.

With this new implementation, you shouldn't encounter the same issues you've described. If you still experience any issues or have further questions, please don't hesitate to reach out.

Thank you for your understanding and patience as we continue to improve the package!

Best regards,
Rohith

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

No branches or pull requests

3 participants