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-23 12:39:31 UTC
Source: https://github.com/cranhaven/cranhaven.r-universe.dev

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))