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

Pre-release #167

Merged
merged 6 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,3 @@ Collate:
'rstac.R'
'rstac-funs.R'
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# rstac (development version)

# rstac 1.0.1 (Released 2024-07-18)

* Add support to `jpg` in `preview_plot()` function (#161)
* Fix variable in filter expressions (non-standard evaluation) (#160)
* Fix `limit` parameter as integer type in `stac_search()` and `items()`
* Improve `items_reap()` documentation (#152)

# rstac 1.0.0 (Released 2024-02-14)

* Add support to static catalogs;
Expand Down
5 changes: 4 additions & 1 deletion R/assets-funs.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@
#' Multiple expressions are combine with `AND` operator. Expressions can
#' use `asset` helper functions (i.e. `asset_key()`, `asset_eo_bands()`,
#' and `asset_raster_bands()`). Multiple expressions are combined with
#' `AND` operator.
#' `AND` operator. `assets_select()` uses non-standard evaluation to evaluate
#' its expressions. That means users must escape any variable or call to
#' be able to use them in the expressions. The escape is done by using
#' `double-curly-braces`, i.e., `{{variable}}`.
#'
#' **WARNING:** Errors in the evaluation of expressions are
#' considered as `FALSE`.
Expand Down
6 changes: 6 additions & 0 deletions R/ext_filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
#' to CQL2 expressions. The following topics describe the correspondences
#' between `rstac` expressions and CQL2 operators.
#'
#' ## Non-standard evaluation
#' - `ext_filter()` uses non-standard evaluation to evaluate its expressions.
#' That means users must escape any variable or call to be able to use them
#' in the expressions. The escape is done by using `double-curly-braces`,
#' i.e., `{{variable}}`.
#'
#' ## Standard comparison operators
#' - `==`, `>=`, `<=`, `>`, `<`, and `!=` operators correspond to
#' `=`, `>=`, `<=`, `>`, `<`, and `<>` in CQL2, respectively.
Expand Down
11 changes: 9 additions & 2 deletions R/items-funs.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,15 @@
#' methods, such as [add_headers][httr::add_headers] or
#' [set_cookies][httr::set_cookies].
#'
#' \item `items_filter()`: ellipsis is used to pass logical
#' expressions to be evaluated against a `doc_item` field as filter criteria.
#' \item `items_filter()`: ellipsis is used to pass logical expressions to
#' be evaluated against a `doc_item` field as filter criteria. Expressions
#' must be evaluated as a logical value where `TRUE` selects the item
#' and `FALSE` discards it. Multiple expressions are combine with `AND`
#' operator. `items_filter()` uses non-standard evaluation to evaluate
#' its expressions. That means users must escape any variable or call to
#' be able to use them in the expressions. The escape is done by using
#' `double-curly-braces`, i.e., `{{variable}}`.

#'
#' **WARNING:** the evaluation of filter expressions changed in `rstac` 0.9.2.
#' Older versions of `rstac` used `properties` field to evaluate filter
Expand Down
5 changes: 2 additions & 3 deletions R/parse-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@
.parse_limit <- function(limit) {
if (length(limit) != 1)
.error("Parameter `limit` must be a single value.")
limit <- as.character(limit)
limit_int <- suppressWarnings(as.integer(limit))
if (any(is.na(as.integer(limit))) || as.character(limit_int) != limit)
limit <- suppressWarnings(as.integer(limit))
if (is.na(limit))
.error("Param `limit` must be an integer.")
return(limit)
}
Expand Down
5 changes: 4 additions & 1 deletion man/assets_functions.Rd

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

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

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

10 changes: 8 additions & 2 deletions man/items_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/preview_plot.Rd

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

Loading