Package 'geoidep'

Title: Download Geographic Data on Various Topics Provided and Managed by the Spatial Data Infrastructure of Peru
Description: Provides R users with easy access to official cartographic data from Peru across a range of topics, including society, transport, environment, agriculture, climate, and more. It also includes data from regional government entities and technical-scientific institutions, all managed by Peru's Spatial Data Infrastructure. For more information, please visit: <https://www.geoidep.gob.pe/catalogos-de-metadatos>.
Authors: antony barja [aut, cre, cph]
Maintainer: antony barja <[email protected]>
License: Apache License (>= 2)
Version: 0.3.0
Built: 2024-11-17 06:12:57 UTC
Source: https://github.com/ambarja/geoidep

Help Index


List providers, description, year and link

Description

This function allows you to list the list of available providers of the geoidep package.

Usage

get_data_sources(query = NULL)

Arguments

query

A string. Default is NULL. List of available providers. For more details, use the 'get_providers' function.

Value

A tibble object.

Examples

library(geoidep)
get_data_sources()

Download INEI departmental boundaries

Description

This function allows you to download the latest version of the geometry and ubigeos corresponding to the official political division of the departament boundaries of Peru. For more information, you can visit the following page https://ide.inei.gob.pe/

Usage

get_departaments(dsn = NULL, show_progress = TRUE, quiet = TRUE)

Arguments

dsn

Character. Output filename. If missing, a temporary file is created.

show_progress

Logical. Suppress bar progress.

quiet

Logical. Suppress info message.

Value

An sf or tibble object.

Examples

library(geoidep)
dep <- get_departaments(show_progress = FALSE)
head(dep)

Download INEI district boundaries

Description

This function allows you to download the latest version of the geometry and ubigeos corresponding to the official political division of the district boundaries of Peru. For more information, you can visit the following page https://ide.inei.gob.pe/

Usage

get_districts(dsn = NULL, show_progress = TRUE, quiet = TRUE)

Arguments

dsn

Character. Output filename with the *.gpkg format. If missing, a temporary file is created.

show_progress

Logical. Suppress bar progress.

quiet

Logical. Suppress info message.

Value

An sf object.

Examples

library(geoidep)
dist <- get_districts(show_progress = FALSE)
head(dist)

Download information on the latest deforestation alerts detected by Geobosque

Description

This function allows you to download deforestation alert information detected by Geobosque for any polygon located in Peru. For more details, please visit the following website: https://geobosques.minam.gob.pe

Usage

get_early_warning(region, sf = TRUE, show_progress = TRUE)

Arguments

region

A string Specifies the unique geographical code of interest.

sf

Logical. Indicates whether to return the data as an 'sf' object.

show_progress

Logical. If TRUE, shows a progress bar during download.

Value

A tibble or sf object, depending on the value of 'sf'.

Examples

library(geoidep)
amazonas <- get_departaments(show_progress = FALSE) |> subset(NOMBDEP == "AMAZONAS")
warning_point <- get_early_warning(region = amazonas, sf = TRUE, show_progress = FALSE)
head(warning_point)

Download available forest fire data from Serfor's Satellite Monitoring Unit

Description

This function allows you to download the latest version of forest fire data available from the Satellite Monitoring Unit of the National Forestry and Wildlife Service of Peru. For more information, please visit the following website: https://sniffs.serfor.gob.pe/monitoreo/sami/index.html

Usage

get_forest_fire_data(dsn = NULL, show_progress = TRUE, quiet = FALSE)

Arguments

dsn

Character. Output filename with the spatial format. If missing, a temporary file is created.

show_progress

Logical. Suppress bar progress.

quiet

Logical. Suppress info message.

Value

An sf object.

Examples

library(geoidep)
library(sf)
fire_forest <- get_forest_fire_data(show_progress = FALSE)
head(fire_forest)

Download the forest and loss information from Geobosque

Description

This function allows you to download the ubigeos corresponding to the official political division of the district, province or region boundaries of Peru with forest and loss information. For more information, you can visit the following website: https://geobosques.minam.gob.pe

Usage

get_forest_loss_data(layer = NULL, ubigeo = NULL, show_progress = TRUE)

Arguments

layer

A string.Specifies one of the following available layers; stock_bosque_perdida_distrito, stock_bosque_perdida_provincia, stock_bosque_perdida_departamento.

ubigeo

A string Specifies the unique geographical code of interest.

show_progress

Logical. Indicates whether to display the progress bar.

Details

Available layers are:

  • stock_bosque_perdida_distrito: Returns data on forest stock, forest loss, rank loss for a given district.

  • stock_bosque_perdida_provincia: Returns data on forest stock, forest loss, rank loss for a given province.

  • stock_bosque_perdida_departamento: Returns data on forest stock, forest loss, rank loss for a given region.

Value

A tibble object.

Examples

library(geoidep)
geobosque <- get_forest_loss_data(
    layer = "stock_bosque_perdida_distrito",
    ubigeo = "010101",
    show_progress = FALSE)
head(geobosque)

Download available hot spot data from Serfor's Satellite Monitoring Unit

Description

This function allows you to download the latest version of forest fire data available from the Satellite Monitoring Unit of the National Forestry and Wildlife Service of Peru. For more information, please visit the following website: https://sniffs.serfor.gob.pe/monitoreo/sami/index.html

Usage

get_hotspots_data(dsn = NULL, show_progress = TRUE, quiet = FALSE)

Arguments

dsn

Character. Output filename with the spatial format. If missing, a temporary file is created.

show_progress

Logical. Suppress bar progress.

quiet

Logical. Suppress info message.

Value

An sf object.

Examples

library(geoidep)
library(sf)
hot_spots <- get_hotspots_data(show_progress = FALSE)
head(hot_spots)

Download Geographic Information from MIDAGRI

Description

This function allows you to download the latest version of MIDAGRI geographic data. For more information you can visit the following page https://siea.midagri.gob.pe/.

Usage

get_midagri_data(layer = NULL, dsn = NULL, show_progress = TRUE, quiet = TRUE)

Arguments

layer

A string. Specifies the layer to download. Available layers are detailed in the 'Details' section.

dsn

Character. The output filename in .shp or .gpkg format. If not provided, a temporary file will be created.

show_progress

Logical. If TRUE, displays a progress bar during the download.

quiet

Logical. If TRUE, suppresses informational messages.

Details

Available layers are:

  • vegetation_cover: Polygons representing agricultural areas of Peru, produced from high-resolution satellite images (RapidEye and Sentinel-2).

  • agriculture_sector: Polygons representing the new national register of agricultural statistical sectors for the year 2024.

  • oil_palm_areas: Polygons representing areas cultivated with oil palm in Peru for the period 2016 to 2020.

  • experimental_stations: Points representing agricultural experimental stations in Peru.

Value

An 'sf' object containing the downloaded geographic data.

Examples

library(geoidep)
library(sf)
# Disable the use of S2 geometry for accurate spatial operations
sf_use_s2(use_s2 = FALSE)

# Retrieve the polygon for Coronel Portillo province
coronel_portillo <- get_provinces(show_progress = FALSE) |>
  subset(NOMBPROV == "CORONEL PORTILLO") |>
  st_transform(crs = 32718)

# Download and extract the oil palm layer for Coronel Portillo
oil_palm <- get_midagri_data(
  layer = "oil_palm_areas",
  show_progress = FALSE
) |>
  st_intersection(coronel_portillo)

# Visualize the oil palm layer
plot(st_geometry(oil_palm))

List resources and count layers of IDEP

Description

Summary of providers

Usage

get_providers(query = NULL)

Arguments

query

Character. Default is NULL.

Value

An sf or tibble object.

Examples

library(geoidep)
get_providers()

Download INEI province boundaries

Description

This function allows you to download the latest version of the geometry and ubigeos corresponding to the official political division of the province boundaries of Peru. For more information, you can visit the following page https://ide.inei.gob.pe/

Usage

get_provinces(dsn = NULL, show_progress = TRUE, quiet = TRUE)

Arguments

dsn

Character. Output filename. If missing, a temporary file is created.

show_progress

Logical. Suppress bar progress.

quiet

Logical. Suppress info message.

Value

An sf or tibble object.

Examples

library(geoidep)
prov <- get_provinces(show_progress = FALSE)
head(prov)

Download the available data from Sernanp

Description

This function allows you to download the latest version of data available on the sernanp geoviewer. For more information, you can visit the following web page: https://geo.sernanp.gob.pe/visorsernanp/

Usage

get_sernanp_data(layer = NULL, dsn = NULL, show_progress = TRUE, quiet = FALSE)

Arguments

layer

Select only one from the list of available layers, for more information please use 'get_data_sources(provider = "sernanp")'. Defaults to NULL.

dsn

Character. Output filename with the spatial format. If missing, a temporary file is created.

show_progress

Logical. Suppress bar progress.

quiet

Logical. Suppress info message.

Value

An sf object.

Examples

library(geoidep)
library(sf)
anp <- get_sernanp_data(layer = "zonificacion_anp" , show_progress = FALSE)
plot(st_geometry(anp))

Retrieve Senamhi's weather alert details using the warning number

Description

This function obtains a table with the specified weather warning number. For more information, please visit the following link: https://www.Senamhi.gob.pe/?&p=aviso-meteorologico

Usage

senamhi_alert_by_number(nro = NULL)

Arguments

nro

A numeric value. Represents the number of the weather warning issued by Senamhi.

Value

A tibble object containing the weather alert data.

Examples

library(geoidep)
data <- senamhi_alert_by_number(295)
head(data)

Download Senamhi's Meteorological Alerts by year

Description

This function downloads the weather forecast table provided by Senamhi according to the specified year.

Usage

senamhi_alerts_by_year(data = NULL, year = NULL)

Arguments

data

A tibble object containing the weather alert data.

year

A numeric value indicating the year of publication of the weather warning.

Examples

library(geoidep)
data <- senamhi_alerts_by_year(year = 2024)
head(data)

Download Weather Alert Table from Senamhi

Description

This function downloads the table of weather warnings provided by Senamhi For more information, please visit the following link: https://www.Senamhi.gob.pe/?&p=aviso-meteorologico

Usage

senamhi_get_meteorological_table()

Value

A tibble object containing the weather alert data.

Examples

library(geoidep)
data <- senamhi_get_meteorological_table()
head(data)

Download Meteorological Alerts from Senamhi

Description

This function downloads and loads the spatial format of the weather warnings provided by Senamhi. These geometries represent preventive forecasts for severe events, indicating the areas that may be affected and the level of danger. For more information, please visit the following link: https://www.Senamhi.gob.pe/?&p=aviso-meteorologico

Usage

senamhi_get_spatial_alerts(
  data = NULL,
  nro = NULL,
  year = NULL,
  dsn = NULL,
  show_progress = TRUE,
  quiet = TRUE
)

Arguments

data

A data frame containing information on weather warnings provided by Senamhi.

nro

A numeric value representing the weather warning number.

year

A numeric value indicating the year of publication of the weather warning.

dsn

A character string specifying the output filename with the spatial format. If missing, a temporary file will be created.

show_progress

A logical value indicating whether to suppress the progress bar.

quiet

A logical value indicating whether to suppress informational messages.

Value

An sf object containing the spatial geometries of the weather alerts.

Examples

library(geoidep)
data <- senamhi_get_spatial_alerts(nro = 295, year = 2024, show_progress = FALSE)
head(data)