Skip to content

Instantly share code, notes, and snippets.

@eleakin
Forked from ianmcook/tx_la_weather_alerts.R
Created August 26, 2020 15:56
Show Gist options
  • Save eleakin/be6184122d0fde21aff7fc7b00c867e2 to your computer and use it in GitHub Desktop.
Save eleakin/be6184122d0fde21aff7fc7b00c867e2 to your computer and use it in GitHub Desktop.
Map of active weather alerts for Texas and Louisiana
remotes::install_github("ianmcook/weatherAlerts")
remotes::install_github("ianmcook/weatherAlertAreas")
library(weatherAlerts)
library(leaflet)
alerts <- getAlerts(c("TX", "LA")) # takes about 45 seconds
severity <- alerts@data$severity
colorMap <- c(Minor = "green",
Moderate = "yellow",
Severe = "red",
Extreme = "magenta",
Unknown = "white")
severityColors <- unname(colorMap[severity])
leaflet() %>%
addTiles() %>%
addPolygons(data = alerts, color = "black", fillColor = severityColors, weight = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment