How is the forest fire distributed in the park?
Where in the park has the most severe fire?
geo_1 =
fire_df %>%
select(X, Y, area) %>%
group_by(X, Y) %>%
mutate(total = sum(area)) %>%
select(-area) %>%
distinct() %>%
ungroup()
geo_2 =
expand.grid(
X = unique(pull(geo_1, X)),
Y = unique(pull(geo_1, X))
)
geo_3 =
merge(
geo_2, geo_1, all = TRUE
) %>%
arrange(Y, X) %>%
mutate(
Y = -Y
)
geo_3[is.na(geo_3)] <- 0
map_image = png::readPNG("./picture/map.png")
map_image_g = grid::rasterGrob(map_image, width = unit(0.89,"npc"), height = unit(0.89,"npc"))
overlap =
ggplot(geo_3, aes(X, Y, fill = total)) +
annotation_custom(map_image_g) +
geom_tile() +
theme_void() +
theme(aspect.ratio = nrow(map_image)/ncol(map_image)) +
scale_fill_gradient(low = "transparent", high = "red")
overlap

X and Y specify the precise coordinates, scatterplot could show forest fire as dots on the map.X and Y specify the grids on map. Consequently, heatmap is used to show severity of fire within each grid.total, which represents “total burned area of fire within each grid”.total in the corresponding grid by color. Transparent means NA or 0. Red represents upper limit of variable total.