Skip to contents

Add a layer to a gpplot2 map with area streets, street names, or both.

Usage

layer_area_streets(
  area = NULL,
  street_type = NULL,
  sha_class = NULL,
  dist = NULL,
  diag_ratio = NULL,
  asp = NULL,
  trim = FALSE,
  msa = FALSE,
  show_streets = TRUE,
  show_names = FALSE,
  name_location = NULL,
  edge_dist = 10,
  color = "gray40",
  size = 1,
  ...
)

Arguments

area

sf object. Returns streets within this area (after adjustment by dist, diag_ratio, and asp parameters)

street_type

selected street subtypes to include. By default, the returned data includes all subtypes except alleys ("STRALY"). Options include c("STRALY", "STRPRD", "STRR", "STREX", "STRFIC", "STRNDR", "STRURD", "STCLN", "STRTN")

sha_class

selected SHA classifications to include. "all" selects all streets with an assigned SHA classification (around one-quarter of all street segments). Additional options include c("COLL", "LOC", "MART", "PART", "FWY", "INT")

dist

buffer distance in meters. Optional.

diag_ratio

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

asp

Aspect ratio of width to height as a numeric value (e.g. 0.33) or character (e.g. "1:3").

trim

Logical. Default FALSE. Trim streets to area using sf::st_intersection().

msa

Logical. Default FALSE. Get streets from cached baltimore_msa_streets.gpkg file using cachedata parameter of get_area_data function.

show_streets

Logical. Default TRUE. If FALSE, hides street center lines.

show_names

Logical. Default FALSE. If TRUE, shows street names.

name_location

Options include c("area", "edge", "top", "left", "bottom", "right", "topleft", "topright", "bottomleft", "bottomright"). Defaults to NULL.

edge_dist

Distance buffer to use for placing street names.

color

Color of streets and/or text of street name labels.

size

Size of the streets and/or street name labels.

...

Other parameters to pass along to ggplot2::geom_sf() that maps the streets.