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

Select items by index in pipe #146

Open
kadyb opened this issue Jan 31, 2024 · 2 comments
Open

Select items by index in pipe #146

kadyb opened this issue Jan 31, 2024 · 2 comments
Assignees
Milestone

Comments

@kadyb
Copy link
Contributor

kadyb commented Jan 31, 2024

Is there a way to select items from collection using index in pipe? Currently I do it this way:

library("rstac")

items <- stac("https://brazildatacube.dpi.inpe.br/stac/") |>
  stac_search(collections = "CB4-16D-2", limit = 30) |>
  post_request()

n = c(1, 4, 10, 20)
items$features = items$features[n]
@rolfsimoes
Copy link
Contributor

I've implemented items_select(items, selection) to be released today in version 1.0.0:

library("rstac")

items <- stac("https://brazildatacube.dpi.inpe.br/stac/") |>
  stac_search(collections = "CB4-16D-2", limit = 30) |>
  post_request() |>
  items_select(c(1, 4, 10, 20))

@rolfsimoes rolfsimoes added this to the Version 1.0.0 milestone Feb 14, 2024
@kadyb
Copy link
Contributor Author

kadyb commented Jun 11, 2024

Thanks! One more small issue. I noticed that items_select() and items_compact() are not listed here:

https://github.com/brazil-data-cube/rstac/blob/b-1.0.1/R/items-funs.R#L7-L52

@rolfsimoes rolfsimoes reopened this Jun 14, 2024
@rolfsimoes rolfsimoes self-assigned this Jun 14, 2024
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