Skip to contents

addWQPSites Internal function to add WQP sites to a leaflet map. If TADA.AURefSource is included in the TADA data frame, the default is to display varying icons to indicate the source of the assessment unit/monitoring location crosswalk. If TADA.AURefSource is not included or the user does not want to display assessment unit identifier information via the icons (by setting ref_icons = FALSE), solid black circle markers are used to display all WQP sites.

Usage

addWQPSites(
  .data,
  map = NULL,
  icons = NULL,
  icon_labels = NULL,
  ref_icons = TRUE,
  overlay_groups = NULL
)

Arguments

.data

A TADA data frame created with TADA_CreateATTAINSAUMLCrosswalk or TADA_CreateAUMLCrosswalk (called "TADA_with_ATTAINS" in the list of output dfs) or a subsetted TADA data frame containing all columns required for building map and pop up (Note: Add list of required columns (HRM 1/5/26)). Needs to be in sumdat format or getWQPSiteStats will be run.

map

A leaflet map of TADA data to apply the symbology for missing ATTAINS AUs to.

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 AUs.

icon_labels

Character argument. The list of icon labels 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 for point AUs.

ref_icons

Boolean argument. Determines whether custom icons are displayed to differentiate between different crosswalk sources for the assignment of WQP Monitoring Locations to Assessment Units if this information is included in the TADA_with_ATTAINS dataframe supplied to the function. When ref_icons = TRUE three different icons will be used for the map.

  1. The circle with the user icon is for matches from the user supplied ref if that was supplied as an input to TADA_CreateAUMLCrosswalk().

  2. The circle with a check mark is for matches from TADA_GetATTAINSAUMLCrosswalk() which runs within TADA_CreateAUMLCrosswalk(). If an organization has recorded this information in ATTAINS, this gets the organizations crosswalk of known monitoring location identifiers and assessment unit associations.

  3. The plain circle represents matches made with TADA_CreateATTAINSAUMLCrosswalk() which also runs within TADA_CreateAUMLCrosswalk() to link catchment-based ATTAINS assessment unit data to Water Quality Portal observations. When ref_icons = FALSE or the source is not provided in .data, all Monitoring Locations are show with a plain circle.

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.

Value

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