Skip to content

Commit

Permalink
Merge pull request #140 from brazil-data-cube/b-0.9.2
Browse files Browse the repository at this point in the history
Pre-release 0.9.2-4
  • Loading branch information
OldLipe authored Jun 15, 2023
2 parents 2b2cecf + cfaef7a commit 7ffe7c3
Show file tree
Hide file tree
Showing 29 changed files with 139 additions and 168 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rstac
Title: Client Library for SpatioTemporal Asset Catalog
Version: 0.9.2-3
Version: 0.9.2-4
Authors@R:
c(person("Rolf", "Simoes",
email = "[email protected]",
Expand Down
6 changes: 3 additions & 3 deletions R/assets-funs.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
#' \dontrun{
#' # assets_download function
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1",
#' stac_search(collections = "CB4-16D-2",
#' datetime = "2019-06-01/2019-08-01") %>%
#' stac_search() %>%
#' get_request() %>%
Expand All @@ -131,7 +131,7 @@
#' \dontrun{
#' # assets_url function
#' stac_item <- stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1", limit = 100,
#' stac_search(collections = "CB4-16D-2", limit = 100,
#' datetime = "2017-08-01/2018-03-01",
#' bbox = c(-48.206,-14.195,-45.067,-12.272)) %>%
#' get_request() %>% items_fetch(progress = FALSE)
Expand All @@ -142,7 +142,7 @@
#' \dontrun{
#' # assets_select function
#' stac_item <- stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1", limit = 100,
#' stac_search(collections = "CB4-16D-2", limit = 100,
#' datetime = "2017-08-01/2018-03-01",
#' bbox = c(-48.206,-14.195,-45.067,-12.272)) %>%
#' get_request() %>% items_fetch(progress = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/collections-query.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#' get_request()
#'
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' collections(collection_id = "CB4_64_16D_STK-1") %>%
#' collections(collection_id = "CB4-16D-2") %>%
#' get_request()
#' }
#'
Expand Down
6 changes: 0 additions & 6 deletions R/ext_filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@
#' # Not equal operator '!=' with collection property
#' req %>% ext_filter(collection != "sentinel-2-l2a") %>% post_request()
#'
#' # Less than operator '<' with cloud_cover property
#' req %>% ext_filter(`eo:cloud_cover` < 10) %>% post_request()
#'
#' # Greater than operator '>' with vegetation_percentage property
#' req %>% ext_filter(`s2:vegetation_percentage` > 50) %>% post_request()
#'
#' # Less than or equal operator '<=' with datetime property
#' req %>% ext_filter(datetime <= "1986-01-01") %>% post_request()
#'
Expand Down
4 changes: 2 additions & 2 deletions R/ext_query.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
#' @examples
#' \dontrun{
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1") %>%
#' ext_query("bdc:tile" %in% "022024") %>%
#' stac_search(collections = "CB4-16D-2") %>%
#' ext_query("bdc:tile" %in% "007004") %>%
#' post_request()
#' }
#'
Expand Down
8 changes: 4 additions & 4 deletions R/items-funs.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
#' @examples
#' \dontrun{
#' x <- stac("https://brazildatacube.dpi.inpe.br/stac") %>%
#' stac_search(collections = "CB4_64_16D_STK-1") %>%
#' stac_search(collections = "CB4-16D-2") %>%
#' stac_search(limit = 500) %>%
#' get_request()
#'
Expand All @@ -164,7 +164,7 @@
#'
#' # STACItem object
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1", limit = 100,
#' stac_search(collections = "CB4-16D-2", limit = 100,
#' datetime = "2017-08-01/2018-03-01",
#' bbox = c(-48.206, -14.195, -45.067, -12.272)) %>%
#' get_request() %>% items_sign(sign_fn = sign_bdc())
Expand All @@ -174,7 +174,7 @@
#' \dontrun{
#' # STACItemCollection object
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1", limit = 100,
#' stac_search(collections = "CB4-16D-2", limit = 100,
#' datetime = "2017-08-01/2018-03-01",
#' bbox = c(-48.206, -14.195, -45.067, -12.272)) %>%
#' get_request() %>%
Expand All @@ -193,7 +193,7 @@
#' \dontrun{
#' # STACItemCollection object
#' stac_item <- stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1", limit = 100,
#' stac_search(collections = "CB4-16D-2", limit = 100,
#' datetime = "2017-08-01/2018-03-01",
#' bbox = c(-48.206, -14.195, -45.067, -12.272)) %>%
#' get_request() %>% items_fetch(progress = FALSE)
Expand Down
6 changes: 3 additions & 3 deletions R/items-query.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
#' @examples
#' \dontrun{
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' collections("CB4_64_16D_STK-1") %>%
#' collections("CB4-16D-2") %>%
#' items(bbox = c(-47.02148, -17.35063, -42.53906, -12.98314)) %>%
#' get_request()
#'
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' collections("CB4_64_16D_STK-1") %>%
#' items("CB4_64_16D_STK_v001_022023_2020-07-11_2020-07-26") %>%
#' collections("CB4-16D-2") %>%
#' items("CB4-16D_V2_000002_20230509") %>%
#' get_request()
#' }
#'
Expand Down
2 changes: 1 addition & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#' # STACItemCollection object
#' stac_item_collection <-
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1",
#' stac_search(collections = "CB4-16D-2",
#' bbox = c(-47.02148, -17.35063, -42.53906, -12.98314),
#' limit = 15) %>%
#' get_request()
Expand Down
2 changes: 1 addition & 1 deletion R/request.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#' get_request()
#'
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1") %>%
#' stac_search(collections = "CB4-16D-2") %>%
#' post_request()
#' }
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/signatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ms_token <- new_env()
#' \dontrun{
#' # STACItemCollection object
#' stac_obj <- stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1",
#' stac_search(collections = "CB4-16D-2",
#' datetime = "2019-06-01/2019-08-01") %>%
#' stac_search() %>%
#' get_request()
Expand Down
4 changes: 2 additions & 2 deletions R/stac_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@
#' \dontrun{
#' # GET request
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1", limit = 10,
#' stac_search(collections = "CB4-16D-2", limit = 10,
#' datetime = "2017-08-01/2018-03-01") %>%
#' get_request()
#'
#' # POST request
#' stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
#' stac_search(collections = "CB4_64_16D_STK-1",
#' stac_search(collections = "CB4-16D-2",
#' bbox = c(-47.02148, -17.35063, -42.53906, -12.98314)) %>%
#' post_request()
#' }
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Cube STAC web service. The `get_request` method makes a HTTP GET connection
to it and retrieves a STAC Catalog document from the server. Each `links`
entry is an available collection that can be accessed via STAC API.

In the code below, we get some STAC items of `CB4_64_16D_STK-1` collection that
In the code below, we get some STAC items of `CB4-16D-2` collection that
intersects the bounding box passed to the `bbox` parameter. To do this, we
call the `stac_search` function that implements the STAC `/search`
endpoint. The returned document is a STAC Item Collection (a geojson
Expand All @@ -107,7 +107,7 @@ containing a feature collection).
```{R bdc-items1, echo=TRUE}
it_obj <- s_obj |>
stac_search(collections = "CB4_64_16D_STK-1",
stac_search(collections = "CB4-16D-2",
bbox = c(-47.02148, -17.35063, -42.53906, -12.98314),
limit = 100) |>
get_request()
Expand All @@ -122,7 +122,7 @@ an example of how to pass a parameter token on a HTTP request.

```{R bdc-items2, eval=FALSE}
it_obj <- s_obj |>
stac_search(collections = "CB4_64_16D_STK-1",
stac_search(collections = "CB4-16D-2",
bbox = c(-47.02148, -17.35063, -42.53906, -12.98314)) |>
get_request(add_headers("x-api-key" = "MY-TOKEN"))
```
Expand Down
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,34 @@ connection to it and retrieves a STAC Catalog document from the server.
Each `links` entry is an available collection that can be accessed via
STAC API.

In the code below, we get some STAC items of `CB4_64_16D_STK-1`
collection that intersects the bounding box passed to the `bbox`
parameter. To do this, we call the `stac_search` function that
implements the STAC `/search` endpoint. The returned document is a STAC
Item Collection (a geojson containing a feature collection).
In the code below, we get some STAC items of `CB4-16D-2` collection that
intersects the bounding box passed to the `bbox` parameter. To do this,
we call the `stac_search` function that implements the STAC `/search`
endpoint. The returned document is a STAC Item Collection (a geojson
containing a feature collection).

``` r

it_obj <- s_obj |>
stac_search(collections = "CB4_64_16D_STK-1",
stac_search(collections = "CB4-16D-2",
bbox = c(-47.02148, -17.35063, -42.53906, -12.98314),
limit = 100) |>
get_request()

it_obj
#> ###STACItemCollection
#> - matched feature(s): 306
#> - features (100 item(s) / 206 not fetched):
#> - CB4_64_16D_STK_v001_022024_2022-08-13_2022-08-28
#> - CB4_64_16D_STK_v001_022025_2022-08-13_2022-08-28
#> - CB4_64_16D_STK_v001_022024_2022-07-28_2022-08-12
#> - CB4_64_16D_STK_v001_022025_2022-07-28_2022-08-12
#> - CB4_64_16D_STK_v001_022024_2022-07-12_2022-07-27
#> - CB4_64_16D_STK_v001_022025_2022-07-12_2022-07-27
#> - CB4_64_16D_STK_v001_022024_2022-06-26_2022-07-11
#> - CB4_64_16D_STK_v001_022025_2022-06-26_2022-07-11
#> - CB4_64_16D_STK_v001_022024_2022-06-10_2022-06-25
#> - CB4_64_16D_STK_v001_022025_2022-06-10_2022-06-25
#> - matched feature(s): 1003
#> - features (100 item(s) / 903 not fetched):
#> - CB4-16D_V2_007004_20230509
#> - CB4-16D_V2_007005_20230509
#> - CB4-16D_V2_007006_20230509
#> - CB4-16D_V2_008004_20230509
#> - CB4-16D_V2_008006_20230509
#> - CB4-16D_V2_008005_20230509
#> - CB4-16D_V2_007004_20230423
#> - CB4-16D_V2_007005_20230423
#> - CB4-16D_V2_007006_20230423
#> - CB4-16D_V2_008004_20230423
#> - ... with 90 more feature(s).
#> - assets:
#> BAND13, BAND14, BAND15, BAND16, CLEAROB, CMASK, EVI, NDVI, PROVENANCE, thumbnail, TOTALOB
Expand All @@ -137,7 +137,7 @@ on a HTTP request.

``` r
it_obj <- s_obj |>
stac_search(collections = "CB4_64_16D_STK-1",
stac_search(collections = "CB4-16D-2",
bbox = c(-47.02148, -17.35063, -42.53906, -12.98314)) |>
get_request(add_headers("x-api-key" = "MY-TOKEN"))
```
Expand All @@ -156,7 +156,7 @@ search criteria:
# it_obj variable from the last code example
it_obj |>
items_matched()
#> [1] 306
#> [1] 1003
```

However, if we count how many items there are in `it_obj` variable, we
Expand All @@ -177,7 +177,7 @@ it_obj <- it_obj |>

it_obj |>
items_length()
#> [1] 306
#> [1] 1003
```

### Download assets
Expand Down Expand Up @@ -236,14 +236,14 @@ Remote Sensing Symposium IGARSS, 2021, pp. 7674-7677, doi:
We acknowledge and thank the project funders that provided financial and
material support:

- Amazon Fund, established by the Brazilian government with financial
contribution from Norway, through the project contract between the
Brazilian Development Bank (BNDES) and the Foundation for Science,
Technology and Space Applications (FUNCATE), for the establishment
of the Brazil Data Cube, process 17.2.0536.1.
- Amazon Fund, established by the Brazilian government with financial
contribution from Norway, through the project contract between the
Brazilian Development Bank (BNDES) and the Foundation for Science,
Technology and Space Applications (FUNCATE), for the establishment of
the Brazil Data Cube, process 17.2.0536.1.

- Radiant Earth Foundation and STAC Project Steering Committee for the
advance of STAC ecosystem programme.
- Radiant Earth Foundation and STAC Project Steering Committee for the
advance of STAC ecosystem programme.

## How to contribute?

Expand Down
6 changes: 3 additions & 3 deletions man/assets_functions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/collections.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/ext_filter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/ext_query.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/items.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7ffe7c3

Please sign in to comment.