layer_area_mask: Add an area mask to a ggplot2 map as a layer

View source: R/layer_area_mask.R

layer_area_maskR Documentation

Add an area mask to a ggplot2 map as a layer

Description

[Deprecated]

This function is deprecated because the functionality has been incorporated into the improved maplayer::layer_mask() function which uses a similar set of parameters.

Returns a mask for an area or areas as an sf object. This function can be called by any function that uses the logical mask parameter.

Usage

layer_area_mask(
  area = NULL,
  diag_ratio = NULL,
  dist = NULL,
  asp = NULL,
  crs = pkgconfig::get_config("mapbaltimore.crs", 2804),
  mask_bbox = NULL,
  ...
)

Arguments

area

sf object. Required. If multiple areas are provided, the areas are combined into a single geometry with sf::st_union()

diag_ratio

ratio to set map extent based diagonal distance of area's bounding box. Ignored when dist is provided.

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").

crs

Coordinate reference system of bounding box to return

mask_bbox

bbox object to define the edge of the mask. diag_ratio, dist, and asp parameters are ignored if a mask_bbox is provided.

...

Additional parameters to pass to ggplot2::geom_sf()

Value

ggplot2::geom_sf() function.


elipousson/mapbaltimore documentation built on Nov. 11, 2024, 8:25 p.m.