diff --git a/R/get_stac_data.R b/R/get_stac_data.R index 7890212..2308a67 100644 --- a/R/get_stac_data.R +++ b/R/get_stac_data.R @@ -184,6 +184,11 @@ #' output_filename = tempfile(fileext = ".tif") #' ) #' +#' landsat_image |> +#' terra::rast() |> +#' terra::stretch() |> +#' terra::plotRGB() +#' #' # The `get_*_imagery()` functions will download #' # all available "data" assets by default #' # (usually including measured values, and excluding derived bands) diff --git a/README.Rmd b/README.Rmd index d8b437d..c38ed7d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -89,7 +89,7 @@ landsat_image <- get_stac_data( terra::plot(terra::rast(landsat_image)) ``` -For these common use cases, however, rsi also provides helper functions which +For common data sets, rsi also provides helper functions which provide most of these arguments for you. For instance, that `get_stac_data()` call could be as simple as: @@ -103,6 +103,15 @@ landsat_image <- get_landsat_imagery( terra::plot(terra::rast(landsat_image)) ``` +Note that we've been plotting each band individually so far by calling `terra::plot()`. We could also use `terra::plotRGB()` (after `terra::stretch()`ing the band values) to see what this mosaic of images would look like to the human eye: + +```{r} +landsat_image |> + terra::rast(lyrs = c("R", "G", "B")) |> + terra::stretch() |> + terra::plotRGB() +``` + By default, these functions download data from Microsoft's Planetary Computer API, using a number of configuration options set in `rsi_band_mapping` objects provided by the package. You can see these default configuration options by diff --git a/README.md b/README.md index 919a993..ae6816e 100644 --- a/README.md +++ b/README.md @@ -136,9 +136,9 @@ terra::plot(terra::rast(landsat_image)) -For these common use cases, however, rsi also provides helper functions -which provide most of these arguments for you. For instance, that -`get_stac_data()` call could be as simple as: +For common data sets, rsi also provides helper functions which provide +most of these arguments for you. For instance, that `get_stac_data()` +call could be as simple as: ``` r landsat_image <- get_landsat_imagery( @@ -152,6 +152,20 @@ terra::plot(terra::rast(landsat_image)) +Note that we’ve been plotting each band individually so far by calling +`terra::plot()`. We could also use `terra::plotRGB()` (after +`terra::stretch()`ing the band values) to see what this mosaic of images +would look like to the human eye: + +``` r +landsat_image |> + terra::rast(lyrs = c("R", "G", "B")) |> + terra::stretch() |> + terra::plotRGB() +``` + + + By default, these functions download data from Microsoft’s Planetary Computer API, using a number of configuration options set in `rsi_band_mapping` objects provided by the package. You can see these @@ -188,7 +202,7 @@ indices <- calculate_indices( terra::plot(terra::rast(indices)) ``` - + And last but not least, rsi includes a utility for efficiently combining rasters containing different data about the same location into a @@ -206,7 +220,7 @@ raster_stack <- stack_rasters( terra::plot(terra::rast(raster_stack)) ``` - + This can be extremely useful as a way to create predictor bricks and other multi-band rasters from various data sources. diff --git a/man/figures/README-unnamed-chunk-5-1.png b/man/figures/README-unnamed-chunk-5-1.png new file mode 100644 index 0000000..5b8806e Binary files /dev/null and b/man/figures/README-unnamed-chunk-5-1.png differ diff --git a/man/figures/README-unnamed-chunk-7-1.png b/man/figures/README-unnamed-chunk-7-1.png index 5db76a1..a5a086d 100644 Binary files a/man/figures/README-unnamed-chunk-7-1.png and b/man/figures/README-unnamed-chunk-7-1.png differ diff --git a/man/figures/README-unnamed-chunk-8-1.png b/man/figures/README-unnamed-chunk-8-1.png new file mode 100644 index 0000000..5db76a1 Binary files /dev/null and b/man/figures/README-unnamed-chunk-8-1.png differ diff --git a/man/get_stac_data.Rd b/man/get_stac_data.Rd index 70bbaa3..780984a 100644 --- a/man/get_stac_data.Rd +++ b/man/get_stac_data.Rd @@ -396,6 +396,11 @@ landsat_image <- get_landsat_imagery( output_filename = tempfile(fileext = ".tif") ) +landsat_image |> + terra::rast() |> + terra::stretch() |> + terra::plotRGB() + # The `get_*_imagery()` functions will download # all available "data" assets by default # (usually including measured values, and excluding derived bands) diff --git a/man/rsi-package.Rd b/man/rsi-package.Rd index 41b9227..2b42c5c 100644 --- a/man/rsi-package.Rd +++ b/man/rsi-package.Rd @@ -24,6 +24,8 @@ Useful links: Other contributors: \itemize{ + \item Felipe Carvalho (Felipe reviewed the package (v. 0.3.0) for rOpenSci, see ) [reviewer] + \item Michael Sumner (Michael reviewed the package (v. 0.3.0) for rOpenSci, see ) [reviewer] \item Permian Global [copyright holder, funder] }