Using the new rsi package examples I am unable to access remote sensing data.
our_aoi <- sf::st_bbox(
c(xmin = 200000, ymin = 900000, xmax = 200100, ymax = 900100),
crs = 26986
)
our_aoi <- sf::st_as_sf(sf::st_as_sfc(our_aoi))
sf::st_area(our_aoi)
#> 10000 [m^2]
plot(sf::st_geometry(our_aoi))
EcoZone <- rsi::get_landsat_imagery(
# Spatial AOI:
aoi = our_aoi,
# Temporal AOI:
start_date = "2023-08-15",
end_date = "2023-08-30",
output_filename = tempfile(fileext = ".tif"))
EcoZone_lcpri
#> [1] "/tmp/RtmpOHg0Pw/file1f8337225bf0.tif"
#Example from here:
san_antonio = sf::st_point(c(-98.491142, 29.424349))
san_antonio = sf::st_sfc(san_antonio, crs = "EPSG:4326")
san_antonio = sf::st_buffer(sf::st_transform(san_antonio, "EPSG:3081"), 5000)
sa_landsat = rsi::get_landsat_imagery(
san_antonio,
start_date = "2023-09-01",
end_date = "2023-10-31",
output_filename = tempfile(fileext = ".tif")
)
sa_landsat
With either of those examples I get:
Warning: Failed to download LC09_L2SP_012031_20230826_02_T1 from 2023-08-26T15:27:00.693890Z [...]: No such file or directory (GDAL error 4)Error: [rast] file does not exist: C:\Users\MEHERE\AppData\Local\Temp\RtmpMHBvri\file6db853474688.tif
I restarted "R version 4.2.0 (2022-04-22 ucrt)" using latest RStudio. These are the packages I am using for my session:
list.of.packages <- c("stringr","here","terra","class","reshape","ggplot2","sf","XML","exiftoolr","curl","RCurl","httr","ncdf4","future","rsi","rstac")
The solution is a bit embarrassing, but perhaps a lesson. My RStudio was calling to an older version of R. I had recently switched to my laptop while my desktop was out for repair. I updated everything, but discovered that RStudio was explicitly set to load an older R version in an older folder despite my recent R update to a new folder.
I discovered this in putting a report together where I ran citation() and noticed that the R version was old.