getSpatialData
getSpatialData copied to clipboard
Landsat download problem: error in evaluating the argument 'y' in selecting a method for function 'intersect': non-character object(s)
I'm working on getting some landsat data, and am getting a strange error.
records <- getLandsat_records(time_range = c("2018-01-01", "2018-08-30"),
products = "landsat_ot_c2_l1",
aoi = casco_extent,
rename_cols = FALSE)
Searching records for product name 'landsat_ot_c2_l1'...
Recieving available product levels from USGS-EROS ESPA...
Found a total of 186 records.
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'y' in selecting a method for function 'intersect': non-character object(s)
What's going on here? When I go into debugOnce() I find it's getting records, but then some merge is failing.
The problem seems to be in getSpatialData:::.make_tileid_landsat()
Also getting same error message with same function for landsat records. Session info below:
library(getSpatialData)
library(sf)
## Linking to GEOS 3.10.2, GDAL 3.4.3, PROJ 8.2.0; sf_use_s2() is TRUE
set_archive("/media/seamus/scandisk-cn/chilwa/data/USGS")
roi = sf::read_sf("./roi/chilwa_watershed_4326.gpkg") |>
st_as_sfc() |>
st_transform(crs = 4326)
set_aoi(st_geometry(roi))
view_aoi()
services()
## • ESA Copernicus Open Hub: 'available' 'Connection successfully established.'
## • ESA Copernicus S5P Hub: 'no connection' 'Connection could not be established.'
## • ESA Copernicus GNSS Hub: 'available' 'Connection successfully established.'
## • USGS-EROS ESPA: 'available' 'Connection successfully established.'
## • USGS EarthExplorer: 'unknown' 'NA'
## • AWS Landsat 8: 'available' 'Connection successfully established.'
## • NASA DAAC LAADS: 'available' 'Connection successfully established.'
`
records <- get_records(
time_range = c("2018-01-01", "2018-08-30"),
products = "landsat_ot_c2_l1",
aoi = roi,
rename_cols = FALSE,
simplify_cols = TRUE,
verbose = TRUE
)
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'y' in selecting a method for function 'intersect': non-character object(s)
8. h(simpleError(msg, call))
7. .handleSimpleError(function (cond)
.Internal(C_tryCatchHelper(addr, 1L, cond)), "non-character object(s)",
base::quote(startsWith(record_ids, SENTINEL1)))
6. startsWith(record_ids, SENTINEL1)
5. which(startsWith(record_ids, SENTINEL1))
4. intersect(which(!is.na(record_ids)), which(startsWith(record_ids,
SENTINEL1)))
3. .make_tileid_sentinel1(records)
2. .make_tileid(records)
1. get_records(time_range = c("2018-01-01", "2018-08-30"), products = "landsat_ot_c2_l1",
aoi = roi, rename_cols = FALSE, simplify_cols = TRUE, verbose = TRUE)