appelmar/gdalcubes

stac_image_collection failed with NL.gpkg !

Closed this issue · 1 comments

Hi,

This code generate an error :

library(sf)
nl_shape = read_sf("NL.gpkg")
bbox = st_bbox(nl_shape) 
st_as_sfc(bbox) |>
  st_transform("EPSG:4326") |>
  st_bbox() -> bbox_wgs84
library(rstac)
s = stac("https://earth-search.aws.element84.com/v0")

items = s |>
  stac_search(collections = "sentinel-s2-l2a-cogs",
              bbox = c(bbox_wgs84["xmin"],bbox_wgs84["ymin"],
                       bbox_wgs84["xmax"],bbox_wgs84["ymax"]), 
              datetime = "2018-06-01/2018-06-30",
              limit = 500) |>
  post_request() 
library(gdalcubes)
s2_collection = stac_image_collection(items$features)

Erreur dans data.frame(id = 1:length(bands), name = bands, type = "", offset = NA, :
les arguments impliquent des nombres de lignes différents : 2, 0, 1

Have you got an idea ? R 4.1.3 and gdalcubes 0.6.0
@+

Thanks, the example works on my machine (R 4.1.3 and gdalcubes 0.6.0, too). Could you maybe share a subset of items$features to find out whether the STAC response looks OK?