Skip to content

Commit

Permalink
Merge pull request #6 from OldLipe/b-0.9.0
Browse files Browse the repository at this point in the history
Update license
  • Loading branch information
gqueiroz authored Sep 2, 2020
2 parents 56a5785 + 00b5baa commit 840cb39
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 76 deletions.
11 changes: 4 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
Package: rstac
Title: R Client Library for SpatioTemporal Asset Catalog
Title: Client Library for SpatioTemporal Asset Catalog
Version: 0.9.0
Authors@R:
c(person("Brazil Data Cube Team",
email = "[email protected]",
role = c("cre", "aut")),
person(given = "National Institute for Space Research (INPE)",
role = c("cph")))
Description:
R client library for STAC is a R package that interfaces STAC API
endpoints.
For more information about the STAC specification, please consult the
specification page (<http://stacspec.org>).
This package supports the version 0.8.1 or higher of the STAC specification.
Description: Provides functions to access, search and download spacetime earth
observation data via SpatioTemporal Asset Catalog (STAC). This package
supports the version 0.8.1 or higher of the STAC specification.
License: MIT + file LICENSE
URL: https://github.com/brazil-data-cube/rstac
BugReports: https://github.com/brazil-data-cube/rstac/issues
Expand Down
23 changes: 2 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
MIT License

Copyright (c) 2020 National Institute for Space Research (INPE)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
YEAR: 2020
COPYRIGHT HOLDER: National Institute for Space Research (INPE)
7 changes: 5 additions & 2 deletions R/collections.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' to STAC API web service.
#'
#' @examples
#' \dontrun{
#' \donttest{
#'
#' stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
#' force_version = "0.8.1") %>%
Expand Down Expand Up @@ -95,7 +95,10 @@ params_post_request.collections <- function(s, enctype) {
content_get_response.collections <- function(s, res) {

# detect expected response object class
content_class <- "stac_collection_list"
if (s$version < "0.9.0")
content_class <- "stac_catalog"
else
content_class <- "stac_collection_list"

if (!is.null(s$params[["collection_id"]]))
content_class <- "stac_collection"
Expand Down
2 changes: 1 addition & 1 deletion R/ext_query.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#' passed to \code{post_request} function.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' # filter items that has 'bdc:tile' property equal to '022024'
#' stac(url = "http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
#' force_version = "0.8.1") %>%
Expand Down
2 changes: 1 addition & 1 deletion R/items.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#' to STAC API web service.
#'
#' @examples
#' \dontrun{
#' \donttest{
#'
#' stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
#' force_version = "0.8.1") %>%
Expand Down
2 changes: 1 addition & 1 deletion R/items_fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' @return a \code{stac_item_collection} object.
#'
#' @examples
#' \dontrun{
#' \donttest{
#'
#' stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
#' force_version = "0.8.1") %>%
Expand Down
2 changes: 1 addition & 1 deletion R/items_length.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' An \code{integer} value.
#'
#' @examples
#' \dontrun{
#' \donttest{
#'
#' stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
#' force_version = "0.8.1") %>%
Expand Down
2 changes: 1 addition & 1 deletion R/items_matched.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' extension, returns \code{NULL}.
#'
#' @examples
#' \dontrun{
#' \donttest{
#'
#' stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
#' force_version = "0.8.1") %>%
Expand Down
2 changes: 1 addition & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#' \code{\link{items}}
#'
#' @examples
#' \dontrun{
#' \donttest{
#'
#' # stac_item_collection object
#' stac_item_collection <- stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
Expand Down
2 changes: 1 addition & 1 deletion R/request.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#' argument.
#'
#' @examples
#' \dontrun{
#' \donttest{
#'
#' stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
#' force_version = "0.8.1") %>%
Expand Down
2 changes: 1 addition & 1 deletion R/stac.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' parameters to be provided to API service.
#'
#' @examples
#' \dontrun{
#' \donttest{
#'
#' stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
#' force_version = "0.8.1") %>%
Expand Down
2 changes: 1 addition & 1 deletion R/stac_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#' to STAC API web service.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' # GET request
#' stac(url = "http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1",
#' force_version = "0.8.1") %>%
Expand Down
53 changes: 32 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ STAC is a specification of files and web services used to describe geospatial
information assets. The specification can be consulted in
[https://stacspec.org/].

R client library for STAC (`rstac`) was designed to fully support STAC v0.8.1.
R client library for STAC (`rstac`) was designed to fully support STAC v0.8.1 and v0.9.0.
As STAC spec is evolving fast and reaching its maturity, we plan update `rstac`
to support upcoming STAC 1.0.0 version soon.

Expand Down Expand Up @@ -41,24 +41,35 @@ the STAC API of the [Brazil Data Cube](http://brazildatacube.org/) project of
the Brazilian National Space Research Institute (INPE).

```R
s_obj <- stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0")
s_obj <- stac("http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1")
get_request(s_obj) %>% print()
#### STAC Catalog
#- stac_version: "0.8.0"
#- id: "bdc"
#- description: "Brazil Data Cube Catalog"
#- links:
# - CB4_64 (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4_64)
# - CB4_64_16D_STK (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4_64_16D_STK)
# - CB4_64_16D_STK_v1 (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4_64_16D_STK_v1)
# - CB4_64_v1 (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4_64_v1)
# - CB4A_55 (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4A_55)
# - CB4A_55_1M_STK (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4A_55_1M_STK)
# - CB4MOSBR_64 (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4MOSBR_64)
# - CB4MOSBR_64_1M_STK (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4MOSBR_64_1M_STK)
# - CB4MOSBR_64_3M_MED (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4MOSBR_64_3M_MED)
# - CB4MOSBR_64_3M_STK (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/collections/CB4MOSBR_64_3M_STK)
#> … with 17 more links
# - stac_version: "0.8.1"
# - id: "bdc"
# - description:
# "Brazil Data Cubes Catalog"
# - links:
# - CB4_64
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/CB4_64)
# - CB4_64_16D_STK
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/CB4_64_16D_STK)
# - CB4_64_16D_STK_v1
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/CB4_64_16D_STK_v1)
# - CB4_64_v1
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/CB4_64_v1)
# - HLS.L30
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/HLS.L30)
# - HLS.S30
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/HLS.S30)
# - L5DN
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/L5DN)
# - L5SR
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/L5SR)
# - L7DN
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/L7DN)
# - L7SR
# (http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.1/collections/L7SR)
# > … with 11 more links
```

The variable `s_obj` stores information to connect to the Brazil Data
Expand Down Expand Up @@ -138,7 +149,7 @@ download_items <- it_obj %>%

The `rstac` package was implemented based on an extensible architecture, so
feel free to contribute by implementing new STAC API
[extensions](https://github.com/radiantearth/stac-spec/tree/v0.8.1/api-spec/extensions)
[extensions](https://github.com/radiantearth/stac-spec/tree/v0.9.0/api-spec/extensions)
based on the STAC API specifications.

1. Make a project
Expand All @@ -149,13 +160,13 @@ your extension and implement the S3 generics methods, `params_get_request`,
`content_get_response` (for HTTP GET) and/or `params_post_request`,
`content_post_response` (for HTTP POST). Using these S3 generics methods you
can define how parameters must be submited to the HTTP request and the types
of the returned documents responses. See the implemented [ext_query](https://github.com/OldLipe/rstac/blob/master/R/extension_query.R)
of the returned documents responses. See the implemented [ext_query](https://github.com/brazil-data-cube/rstac/blob/master/R/ext_query.R)
API extension as an example.
4. Make a [Pull Request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) on the branch dev.
4. Make a [Pull Request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) on the branch [dev](https://github.com/OldLipe/rstac/tree/dev).

## Getting help

You can get a full explanation about each STAC (v0.8.1) endpoint at [STAC spec GitHub](https://github.com/radiantearth/stac-spec/tree/v0.8.1). A detailed
You can get a full explanation about each STAC (v0.9.0) endpoint at [STAC spec GitHub](https://github.com/radiantearth/stac-spec/tree/v0.9.0). A detailed
documentation with examples on how to use each endpoint and other functions
available in the `rstac` package can be obtained by typing `?rstac` in R
console.
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.

2 changes: 1 addition & 1 deletion man/extension_query.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/items.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/items_fetch.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/items_length.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/items_matched.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/print.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/request.Rd

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

8 changes: 3 additions & 5 deletions man/rstac.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/stac.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/stac_search.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-examples.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ testthat::test_that("examples rstac", {
force_version = "0.8.1") %>%
rstac::collections() %>%
rstac::get_request(),
class = "stac_collection_list")
class = "stac_catalog")

# test collections items - /collections/{collection_id}
testthat::expect_s3_class(
Expand Down

0 comments on commit 840cb39

Please sign in to comment.