Analyzing forest fires with the geoideo package"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  dpi = 300,
  out.width = "100%" 
)

1. Introduction

geoidep currently allows you to work with data from Serfor's Satellite Tracking Unit.

However, this project is still under construction, for more information you can visit the GitHub official repository https://github.com/ambarja/geoidep.

If you want to support this project, you can support me with a coffee for my programming moments.

2. Package installation

install.packages("geoidep")

Also, you can install the development version as follows:

install.packages('pak')
pak::pkg_install('ambarja/geoidep')
library(geoidep)

3. Filter the available Serfor layer

providers <- get_data_sources(query = "Serfor")
providers

4. Forest fire data collection download

incendio.forestal <- get_forest_fire_data(show_progress = FALSE)
head(incendio.forestal)

5. National Forest Fire Count

library(sf)
library(dplyr)
library(ggplot2)
stats <- incendio.forestal |> 
  st_drop_geometry() |>
  filter(FECHA >= '2024-09-11') |> 
  group_by(NOMDEP) |> 
  summarise( total = n()) 
# Simple visualisation
stats |> 
  ggplot(aes(x = NOMDEP, y = total)) + 
  geom_bar(stat = "identity") + 
  coord_polar() + 
  theme_minimal(base_size = 10)  + 
  labs(x="", y = "", caption = "Unidad de Monitoreo Forestales - SERFOR")

6. Download the official INEI administrative limits of interest

# Region boundaries download 
ucayali_dep <- get_departaments(show_progress = FALSE) |> 
  subset(NOMBDEP == 'UCAYALI')
# The first five rows
head(ucayali_dep)

7. Forest fire count in the area of interest only

# Data collection only within the regions of interest.
ucayali.if <- st_filter(incendio.forestal, ucayali_dep)
head(ucayali.if)

8. Simple visualization with leaflet

library(leaflet)
library(leaflet.extras)
ucayali.if |> 
  leaflet() |> 
  addProviderTiles(provider = "CartoDB.Positron") |> 
  addHeatmap(radius = 10,minOpacity = 1)


Try the geoidep package in your browser

Any scripts or data that you put into this service are public.

geoidep documentation built on Sept. 23, 2024, 1:06 a.m.