Skip to content

Instantly share code, notes, and snippets.

@ianmcook
Last active October 15, 2017 05:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianmcook/c75bb81011276c23441b9048656e2e76 to your computer and use it in GitHub Desktop.
Save ianmcook/c75bb81011276c23441b9048656e2e76 to your computer and use it in GitHub Desktop.
Map of active weather alerts for Texas
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)
@ianmcook
Copy link
Author

ianmcook commented Aug 27, 2017

At 2017-08-27 08:30 CDT in the wake of Hurricane Harvey:
harvey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment