Skip to contents

addATTAINS Internal function to add ATTAINS assessment units (lines, points, or polygons) or ATTAINS catchments (polygons) to TADA maps.

Usage

addATTAINS(
  .data,
  map = NULL,
  overlay_groups = NULL,
  icons = NULL,
  catchment = FALSE,
  catchment_type = "attains_au"
)

Arguments

.data

A data frame created using prepATTAINSMapper (must contain a geometry column).

map

The TADA leaflet map to add the ATTAINS geometry to. Required, function will not run with map is missing or NULL. Default is map = NULL.

overlay_groups

Initialized vector to add names of groups to map. This is to allow users to toggle specific layers on/off. If it is NULL, the function will fail with an error message. Default is overlay_list = NULL.

icons

Character argument. The list of icon paths generated by the internal function getMapIconLabels. If already called in a larger mapping function, it can be referenced here (for efficiency). If icons = NULL, getMapIconLabels will run and fetch the list. Default is icons = NULL. This argument is only applied to for point assessment units.

catchment

Boolean argument. Specifies whether the geometries being mapped are catchments or assessment units to determine color and other attributes. Default is catchment = FALSE, meaning that assessment units are being mapped.

catchment_type

Character argument. Evaluated when catchment = TRUE to determine if the catchments being mapped are (1) those corresponding to assessment units that are missing point/line/polygon data but still preserved in the catchment layer (catchment_type = "missing_raw"), (2) catchments containing assessment unit features (catchment_type = "attains_au") or (3) NHD catchments missing from ATTAINS (catchment_type = "wo_attains). Default is catchment_type = "attains_au".

Value

ATTAINS geometry correctly formatted for display in a TADA leaflet map.