Last active
October 11, 2020 05:21
-
-
Save deanmarchiori/cb64f105eb0f6204eaa88323eaa29fdb to your computer and use it in GitHub Desktop.
Mapping NSW Current Incidents in R
This file contains 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
# Mapping NSW Current Incidents in R ------------------------------------------- | |
library(sf) | |
library(mapview) | |
library(tidyverse) | |
#' Current Incidents Feed (GeoJSON) | |
#' This feed contains a list of current incidents from the NSW RFS, | |
#' and includes location data and Major Fire Update summary information where available. | |
#' Click through from the feed to the NSW RFS website for full details of the update. | |
#' GeoJSON is a lightweight data standard that has emerged to support the sharing of | |
#' information with location or geospatial data. | |
#' It is widely supported by modern applications and mobile devices. | |
#' See here: https://www.rfs.nsw.gov.au/news-and-media/stay-up-to-date/feeds for attribution and guidelines | |
url <- "http://www.rfs.nsw.gov.au/feeds/majorIncidents.json" | |
fires <- st_read(url) | |
# points only | |
fires %>% | |
st_cast("POINT") %>% | |
mapview(layer.name = "RFS Current Incident Locations", zcol = "category") | |
#' Polygons only | |
fires %>% | |
st_buffer(dist = 0) %>% | |
st_union(by_feature = TRUE) %>% | |
mapview(layer.name = "RFS Current Incident Polygons", zcol = "category") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment