View source: R/retrieve_layers.R
get_image_layer | R Documentation |
This function retrieves image service layers from an ArcGIS
REST services API and returns them as a RasterStack
object
get_image_layer(
url,
sf_object = NULL,
bbox = NULL,
bbox_crs = NULL,
token = "",
clip_raster = TRUE,
format = "png",
transparent = TRUE,
...
)
url |
A character string of the url for the layer to pull |
sf_object |
An |
bbox |
Vector of bounding box coordinates |
bbox_crs |
CRS for bbox (required if bbox is used) |
token |
A character string of the token (if needed) |
clip_raster |
Logical. Should the raster be clipped to contain only
the pixels that reside in the |
format |
The raster format desired. Default is "png" |
transparent |
Logical. Retrieve a raster with a transparent background (TRUE, default) or not (FALSE) |
... |
Additional arguments to pass to the ArcGIS REST API |
This is one of the core functions of the package. It retrieves image service
layers from an ArcGIS REST API designated by the URL. These layers require a
bounding box to query the map layer, which is either taken from the
sf_object
argument or optionally can be passed via the bbox
argument. Either sf_object
or bbox
are optional, but one of
them must be present.
All of the querying parameters are sent via a POST request to the URL, so
if there are issues with passing additional parameters via ...
first determine how they fit into the POST request and make adjustments as
needed. This syntax can be tricky if you're not used to it.
A "RasterStack" object
## Not run:
wi_leaf_off_layer <- get_image_layer(wi_leaf_off_url, wis_poly)
plot_layer(wi_leaf_off_layer, outline_poly = wis_poly)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.