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 |
This function allows you to list the list of available providers of the geoidep package.
get_data_sources(query = NULL)
get_data_sources(query = NULL)
query |
A string. Default is NULL. List of available providers. For more details, use the 'get_providers' function. |
A tibble object.
library(geoidep) get_data_sources()
library(geoidep) get_data_sources()
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/
get_departaments(dsn = NULL, show_progress = TRUE, quiet = TRUE)
get_departaments(dsn = NULL, show_progress = TRUE, quiet = TRUE)
dsn |
Character. Output filename. If missing, a temporary file is created. |
show_progress |
Logical. Suppress bar progress. |
quiet |
Logical. Suppress info message. |
An sf or tibble object.
library(geoidep) dep <- get_departaments(show_progress = FALSE) head(dep)
library(geoidep) dep <- get_departaments(show_progress = FALSE) head(dep)
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/
get_districts(dsn = NULL, show_progress = TRUE, quiet = TRUE)
get_districts(dsn = NULL, show_progress = TRUE, quiet = TRUE)
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. |
An sf object.
library(geoidep) dist <- get_districts(show_progress = FALSE) head(dist)
library(geoidep) dist <- get_districts(show_progress = FALSE) head(dist)
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
get_early_warning(region, sf = TRUE, show_progress = TRUE)
get_early_warning(region, sf = TRUE, show_progress = TRUE)
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. |
A tibble or sf object, depending on the value of 'sf'.
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)
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)
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
get_forest_fire_data(dsn = NULL, show_progress = TRUE, quiet = FALSE)
get_forest_fire_data(dsn = NULL, show_progress = TRUE, quiet = FALSE)
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. |
An sf object.
library(geoidep) library(sf) fire_forest <- get_forest_fire_data(show_progress = FALSE) head(fire_forest)
library(geoidep) library(sf) fire_forest <- get_forest_fire_data(show_progress = FALSE) head(fire_forest)
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
get_forest_loss_data(layer = NULL, ubigeo = NULL, show_progress = TRUE)
get_forest_loss_data(layer = NULL, ubigeo = NULL, show_progress = TRUE)
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. |
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.
A tibble object.
library(geoidep) geobosque <- get_forest_loss_data( layer = "stock_bosque_perdida_distrito", ubigeo = "010101", show_progress = FALSE) head(geobosque)
library(geoidep) geobosque <- get_forest_loss_data( layer = "stock_bosque_perdida_distrito", ubigeo = "010101", show_progress = FALSE) head(geobosque)
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
get_hotspots_data(dsn = NULL, show_progress = TRUE, quiet = FALSE)
get_hotspots_data(dsn = NULL, show_progress = TRUE, quiet = FALSE)
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. |
An sf object.
library(geoidep) library(sf) hot_spots <- get_hotspots_data(show_progress = FALSE) head(hot_spots)
library(geoidep) library(sf) hot_spots <- get_hotspots_data(show_progress = FALSE) head(hot_spots)
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/.
get_midagri_data(layer = NULL, dsn = NULL, show_progress = TRUE, quiet = TRUE)
get_midagri_data(layer = NULL, dsn = NULL, show_progress = TRUE, quiet = TRUE)
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. |
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.
An 'sf' object containing the downloaded geographic data.
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))
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))
Summary of providers
get_providers(query = NULL)
get_providers(query = NULL)
query |
Character. Default is NULL. |
An sf or tibble object.
library(geoidep) get_providers()
library(geoidep) get_providers()
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/
get_provinces(dsn = NULL, show_progress = TRUE, quiet = TRUE)
get_provinces(dsn = NULL, show_progress = TRUE, quiet = TRUE)
dsn |
Character. Output filename. If missing, a temporary file is created. |
show_progress |
Logical. Suppress bar progress. |
quiet |
Logical. Suppress info message. |
An sf or tibble object.
library(geoidep) prov <- get_provinces(show_progress = FALSE) head(prov)
library(geoidep) prov <- get_provinces(show_progress = FALSE) head(prov)
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/
get_sernanp_data(layer = NULL, dsn = NULL, show_progress = TRUE, quiet = FALSE)
get_sernanp_data(layer = NULL, dsn = NULL, show_progress = TRUE, quiet = FALSE)
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. |
An sf object.
library(geoidep) library(sf) anp <- get_sernanp_data(layer = "zonificacion_anp" , show_progress = FALSE) plot(st_geometry(anp))
library(geoidep) library(sf) anp <- get_sernanp_data(layer = "zonificacion_anp" , show_progress = FALSE) plot(st_geometry(anp))