-
-
Save eleakin/be6184122d0fde21aff7fc7b00c867e2 to your computer and use it in GitHub Desktop.
Map of active weather alerts for Texas and Louisiana
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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