This is an internal function to pull raster layers from either a map service
or an image service of an ArcGIS REST API. This function is the engine that
drives get_map_layer and get_image_layer
get_raster_layer(
url,
sf_object = NULL,
bbox = NULL,
bbox_crs = NULL,
token = "",
clip_raster = TRUE,
format = "png",
transparent = TRUE,
export_type = "map",
add_legend = FALSE,
...
)An object of type SpatRaster
A character string of the url for the layer to pull
An sf object used for the bounding box
Vector of bounding box coordinates
CRS for bbox (required if bbox is used)
A character string of the token (if needed)
Logical. Should the raster be clipped to contain only
the pixels that reside in the sf_object? By default, ArcGIS returns
some overlapping edge pixels. Setting clip_raster to TRUE (default)
will remove these using mask from the raster
package
The raster format desired. Default is "png"
Logical. Retrieve a raster with a transparent background (TRUE, default) or not (FALSE)
Character. Either "map" or "image" for the respective service layer desired
Logical. Pull legend and match to color values (TRUE, default) or not (FALSE)
Additional arguments to pass to the ArcGIS REST API