R/layer_spatraster.R

Defines functions layer_spatraster

Documented in layer_spatraster

#' Deprecated: Use `tidyterra::geom_spatraster_rgb()`
#'
#' @description
#'
#' `r lifecycle::badge("deprecated")`
#'
#' This function is deprecated. Use [tidyterra::geom_spatraster_rgb()] for
#' plot tiles with ggplot2.
#'
#' @seealso [tidyterra::geom_spatraster_rgb()].
#'
#' @export
#'
#' @keywords internal
#'
#' @param data Deprecated.
#' @param ... Deprecated
#'
#' @return An error
#'
#' @examplesIf esp_check_access()
#' \dontrun{
#'
#' # Get a SpatRaster
#'
#' x <- esp_get_ccaa("Galicia", epsg = 3857)
#'
#' tile <- esp_getTiles(x, "IGNBase.Todo")
#'
#' class(tile)
#'
#' library(ggplot2)
#' # Use tidyterra
#' library(tidyterra)
#'
#' ggplot(x) +
#'   geom_spatraster_rgb(data = tile) +
#'   geom_sf(color = "yellow", fill = NA) +
#'   theme_minimal()
#' }
#'
layer_spatraster <- function(data, ...) {
  stop(
    "`layer_spatraster() is deprecated on mapSpain v0.6.2`. Use ",
    "`tidyterra::geom_spatraster_rgb()` instead."
  )
}

Try the mapSpain package in your browser

Any scripts or data that you put into this service are public.

mapSpain documentation built on July 26, 2023, 5:29 p.m.