Map WAMTRAM data

map_wamtram(
  data,
  location = NULL,
  place = NULL,
  obs_id = NULL,
  wa_sites = NULL,
  l_width = NULL,
  l_height = NULL
)

Arguments

data

The output of wastdr::download_w2_data().

location

A W2 location code, e.g. "TH", to filter the data by.

place

A W2 place code, e.g. "THEE", to filter the data by. Providing place overrides location.

obs_id

An Observation ID to filter W2 obs by.

wa_sites

WAStD Sites (joined to Localities) to display.

l_width

The parameter width for leaflet::leaflet().

l_height

The parameter height for leaflet::leaflet().

Value

A leaflet map showing W2 sites and encounters.

See also

Other wamtram: download_w2_data(), w2_online()

Examples

if (FALSE) {
data("w2_data", package = "etlTurtleNesting")
w2_data <- readRDS("~/projects/etlTurtleNesting/inst/w2.rds")
map_wamtram(w2_data)

map_wamtram(w2_data, location = "DH")
map_wamtram(w2_data, place = "THEE")

map_wamtram(w2_data, place = "WKBB", l_height = "calc(100vh - 80px)")

# With WAStD Sites
areas_sf <- wastd_GET("area") %>%
  magrittr::extract2("data") %>%
  geojsonio::as.json() %>%
  geojsonsf::geojson_sf()

areas <- areas_sf %>%
  dplyr::filter(area_type == "Locality") %>%
  dplyr::transmute(area_id = pk, area_name = name, w2_location_code = w2_location_code)

sites <- areas_sf %>%
  dplyr::filter(area_type == "Site") %>%
  dplyr::transmute(site_id = pk, site_name = name, w2_place_code = w2_place_code) %>%
  sf::st_join(areas)

map_wamtram(w2_data, place = "THEE", wa_sites = sites)
}