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 |
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))
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
senamhi_alert_by_number(nro = NULL)
senamhi_alert_by_number(nro = NULL)
nro |
A numeric value. Represents the number of the weather warning issued by Senamhi. |
A tibble object containing the weather alert data.
library(geoidep) data <- senamhi_alert_by_number(295) head(data)
library(geoidep) data <- senamhi_alert_by_number(295) head(data)
This function downloads the weather forecast table provided by Senamhi according to the specified year.
senamhi_alerts_by_year(data = NULL, year = NULL)
senamhi_alerts_by_year(data = NULL, year = NULL)
data |
A tibble object containing the weather alert data. |
year |
A numeric value indicating the year of publication of the weather warning. |
library(geoidep) data <- senamhi_alerts_by_year(year = 2024) head(data)
library(geoidep) data <- senamhi_alerts_by_year(year = 2024) head(data)
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
senamhi_get_meteorological_table()
senamhi_get_meteorological_table()
A tibble object containing the weather alert data.
library(geoidep) data <- senamhi_get_meteorological_table() head(data)
library(geoidep) data <- senamhi_get_meteorological_table() head(data)
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
senamhi_get_spatial_alerts( data = NULL, nro = NULL, year = NULL, dsn = NULL, show_progress = TRUE, quiet = TRUE )
senamhi_get_spatial_alerts( data = NULL, nro = NULL, year = NULL, dsn = NULL, show_progress = TRUE, quiet = TRUE )
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. |
An sf object containing the spatial geometries of the weather alerts.
library(geoidep) data <- senamhi_get_spatial_alerts(nro = 295, year = 2024, show_progress = FALSE) head(data)
library(geoidep) data <- senamhi_get_spatial_alerts(nro = 295, year = 2024, show_progress = FALSE) head(data)