View source: R/layer_area_data.R
layer_area_data | R Documentation |
This function is deprecated because the functionality has been incorporated
into the improved maplayer::layer_location_data()
function which uses a
similar set of parameters.
Layer for ggplot to show data for an area or area bbox.
Combines get_area_data and geom_sf into a single call. Inherits data from ggplot() if data, extdata, and cachedata are left as NULL. Set asis to TRUE to keep data as is and not crop to area or modified area. Optionally can combine data layer with a mask layer, an area layer, and any additional number of layers after those three. The appearance of the area layer can be modified with fixed aesthetics using the area_aes parameter. Fixed aesthetics for the data layer can be added as additional parameters.
layer_area_data(
area = NULL,
bbox = NULL,
data = NULL,
extdata = NULL,
cachedata = NULL,
path = NULL,
url = NULL,
fn = NULL,
asis = FALSE,
diag_ratio = NULL,
dist = NULL,
asp = NULL,
crop = TRUE,
trim = FALSE,
crs = pkgconfig::get_config("mapbaltimore.crs", 2804),
mapping = ggplot2::aes(),
inherit.aes = TRUE,
show_mask = FALSE,
show_area = FALSE,
area_aes = list(color = "gray30"),
layer_after = NULL,
...
)
area |
|
bbox |
|
data |
|
extdata |
Character. Name of an external geopackage (.gpkg) file included with the package where selected data is available. Available data includes "trees", "unimproved_property", and "vegetated_area" |
cachedata |
Character. Name of a cached geopackage (.gpkg) file where
selected data is available. Running |
path |
Character. Path to local or remote spatial data file supported by
|
url |
Character. URL for FeatureServer or MapServer layer to pass to get_area_esri_data. |
fn |
Function to apply to area data before returning. |
asis |
Logical. Default FALSE. If TRUE, use inherited data as is without cropping to area. |
diag_ratio |
ratio to set map extent based diagonal distance of area's
bounding box. Ignored when |
dist |
buffer distance in meters. Optional. |
asp |
Aspect ratio of width to height as a numeric value (e.g. 0.33) or character (e.g. "1:3"). |
crop |
If TRUE, data cropped to area or bounding box
|
trim |
If TRUE, data trimmed to area with
|
crs |
Coordinate Reference System (CRS) to use for the returned data. The CRS of the provided data and bounding box or area must match one another but are not required to match the CRS provided by this parameter. |
show_mask |
Logical. Default FALSE. If TRUE, add a mask using
|
show_area |
Logical. Default FALSE. If TRUE, add an outline of the area to the layer. |
area_aes |
List of fixed aesthetics for area layer. Default to list(color = "gray30", fill = NA). Supported aesthetics include color, fill, linetype, alpha, and size. Defaults to color = "gray30", fill = NA, size = 0.75, alpha = 1, linetype = 0. Default aesthetics for geom_sf are ignored. |
layer_after |
ggplot objects to append to the end of the data, mask, area layer list. This is intended to be used to append scales, guides, or labels related to the the data layer. |
... |
Arguments passed on to
|
NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.