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

ne_download() fails to read raster objects #96

Closed
eliocamp opened this issue Nov 21, 2023 · 2 comments
Closed

ne_download() fails to read raster objects #96

eliocamp opened this issue Nov 21, 2023 · 2 comments

Comments

@eliocamp
Copy link

Reprex:

rast <- rnaturalearth::ne_download(category = "raster", type = "HYP_50M_SR_W", scale = 50)
#> Warning: The `returnclass` argument of `ne_download()` sp as of rnaturalearth 1.0.0.
#> ℹ Please use `sf` objects with {rnaturalearth}, support for Spatial objects
#>   (sp) will be removed in a future release of the package.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: /tmp/RtmpV6NNlD/HYP_50M_SR_W/HYP_50M_SR_W.tif: No such file or
#> directory (GDAL error 4)
#> Error: [rast] file does not exist: /tmp/RtmpV6NNlD/HYP_50M_SR_W/HYP_50M_SR_W.tif

Created on 2023-11-21 with reprex v2.0.2

The problem is that HYP_50M_SR_W.tif is not in the HYP_50M_SR_W subdir.
This

rst <- terra::rast(file.path(destdir, file_name, paste0(file_name, ".tif")))

Might need to be

 rst <- terra::rast(file.path(destdir, paste0(file_name, ".tif"))) 
@eliocamp
Copy link
Author

Sorry, I've just noticed that this is addressed in #52

@PMassicotte
Copy link
Contributor

Thank you, just fixed it in the dev version.

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

2 participants