-
Notifications
You must be signed in to change notification settings - Fork 16
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
Should filtering using variable work in items_filter()
?
#160
Comments
Thank you for spotting this. The behavior you observed is indeed a bug in the The fix will be included in the next release on CRAN, which should be available soon. In the meantime, you can install the development version from GitHub to use the fix right away. Here’s how you can do it using the # Install the remotes package if you haven't already
install.packages("remotes")
# Install the development version of rstac from GitHub
remotes::install_github("brazil-data-cube/[email protected]") Additionally, the correct way to use variables inside expressions in library("rstac")
stac("https://earth-search.aws.element84.com/v1") |>
stac_search(
collections = "sentinel-2-c1-l2a",
bbox = c(22, 51, 23, 52),
datetime = "2023-01-01T00:00:00Z/2023-01-02T00:00:00Z") |>
post_request() -> items
id = items$features[[1]]$properties$`s2:tile_id`
id
#> "S2A_OPER_MSI_L2A_TL_2APS_20230101T135652_A039315_T34UEB_N05.09"
# Now this works with the fix
items |>
items_filter(properties$`s2:tile_id` == {{id}})
#> - features (1 item(s) / 3 not fetched):
#> - S2A_T34UEB_20230101T093407_L2A I appreciate your patience and contributions to Best regards, |
Thank you!
Maybe you can add such an example to the documentation? I wasn't aware it had to be used in this way. |
I tried filtering the scene ID using the variable in
items_filter()
, but it didn't work. However, if I pass it as text, it works. Is this expected behavior?The text was updated successfully, but these errors were encountered: