library(giscourse)
library(dplyr)
library(raster)
library(mapview) 

Load fire points

CThe cde has already been set up on the server to load all the available points from the modis detected fire coordinates.

conn<-sconnect11()
d<-get_fires(146,-41.5, dist=2.4)

Quick map

mapview(d,color="red", col.regions="red") %>% giscourse::hansen_wms()

Show 30 day rolling average of counts

library(lubridate)
library(xts)
library(dygraphs)
d %>% st_set_geometry(NULL) %>% group_by(day) %>% summarise(n=n()) -> ts1

dygraph(xts(ts1$n,order.by = ts1$day))  %>%  dyRoller(rollPeriod = 30) %>% dyRangeSelector() 

Cross with landcover classifications

lc<-get_lc(146,-41.5,dist=320)
plot(lc$lc)

land_cover<-data.frame(id=raster::extract(lc$lc,as(d,"Spatial")))
land_cover<-base::merge(land_cover,lc$legend)
data.frame(table(land_cover$land_cover)) %>% DT::datatable()

Kernel density

xy<-st_coordinates(d)
library(MASS)
k <- kde2d(xy[,1],xy[,2],h=.1,n=1000)
r <- raster(k)
r[r<0.1]<-NA
library(RColorBrewer)

pal<-RColorBrewer::brewer.pal(11,"Spectral")[11:1]

plot(r, col=pal)

mapview(r, na.color="transparent") %>% giscourse::global_landcover_wms()