Last active
October 15, 2017 05:32
-
-
Save ianmcook/c75bb81011276c23441b9048656e2e76 to your computer and use it in GitHub Desktop.
Map of active weather alerts for Texas
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
devtools::install_github("ianmcook/weatherAlerts") | |
devtools::install_github("ianmcook/weatherAlertAreas") | |
library(weatherAlerts) | |
library(leaflet) | |
alerts <- getAlerts("TX") # takes about 20 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
At 2017-08-27 08:30 CDT in the wake of Hurricane Harvey:
