Geoidep
π₯ Download geographic data on various topics provided and managed by the Spatial Data Infrastructure of Peru ππ.
Install / Use
/learn @ambarja/GeoidepREADME
<!-- README.md is generated from README.Rmd. Please edit that file -->
geoidep: Download Geographic Data Managed by Peruβs Spatial Data Infrastructure
<!-- badges: start --> <!-- badges: end --> <img align="right" src="https://raw.githubusercontent.com/ambarja/geoidep/refs/heads/main/man/figures/geoidep_logo_b.png" alt="logo" width="124" style="margin-left: 5px;margin-right: 5px;"> <img align="right" src="https://raw.githubusercontent.com/ambarja/geoidep/refs/heads/main/man/figures/geoidep_logo_o.png" alt="logo" width="124" style="margin-left: 5px;margin-right: 5px;"> <p align="justify"> The goal of <b>geoidep</b>π¦ is to offers R users an easy and accessible way to obtain official cartographic data on various topics, such as <b>society</b>ποΈ,<b> transport</b>π, <b>environment</b>π±, <b>agriculture</b>πΎ, <b>climate</b>β οΈ,among others.This includes information provided by regional government entities and technical-scientific institutions, managed by the <b>Spatial Data Infrastructure of Peru</b>. </p>β οΈ The package accesses these datasets dynamically from official public servers, without redistributing data locally.
The package is currently available in R and Python (coming soon).
<hr>Installation R
You can install the development version of geoidep like so:
install.packages('pak')
pak::pkg_install('ambarja/geoidep')
or also the official version available on CRAN:
install.packages('geoidep')
Example 01: Introduction
library(geoidep)
ββ Welcome to geoidep βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΉ geoidep is a wrapper that enables you to download cartographic data for Peru directly from R.
βΉ Currently, `geoidep` supports data from the following providers:
β’ Geobosque
β’ INAIGEM
β’ INEI
β’ Midagri
β’ and more!
βΉ For more information, please use the `get_data_sources()` function.
In this example, we can identify the list of providers available in geoidep and the layers they present.
get_data_sources() |>
head()
#> # A tibble: 6 Γ 7
#> provider category layer layer_can_be_actived admin_en year link_geoportal
#> <chr> <chr> <chr> <lgl> <chr> <chr> <chr>
#> 1 INEI General depaβ¦ TRUE Nationaβ¦ 2019 https://ide.iβ¦
#> 2 INEI General provβ¦ TRUE Nationaβ¦ 2019 https://ide.iβ¦
#> 3 INEI General distβ¦ TRUE Nationaβ¦ 2019 https://ide.iβ¦
#> 4 Midagri Agriculture agriβ¦ TRUE Ministrβ¦ 2024 https://siea.β¦
#> 5 Midagri Agriculture oil_β¦ TRUE Ministrβ¦ 2016β¦ https://siea.β¦
#> 6 Geobosque Forest stocβ¦ FALSE Ministrβ¦ 2001β¦ https://geoboβ¦
In summary the suppliers and the number of available layers
get_providers()
#> # A tibble: 9 Γ 2
#> provider layer_count
#> <fct> <int>
#> 1 Geobosque 5
#> 2 INAIGEM 5
#> 3 INEI 7
#> 4 Midagri 2
#> 5 MTC 26
#> 6 Senamhi 1
#> 7 Serfor 1
#> 8 Sernanp 31
#> 9 SIGRID 4
Example 02: Download official INEI administrative boundaries
This is a simple example of how to download Peruβs official administrative boundaries:
dep <- get_departaments(show_progress = FALSE)
The first 10 rows of the original data are displayed here:
head(dep)
#> Simple feature collection with 6 features and 6 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -79.45857 ymin: -17.28501 xmax: -70.80408 ymax: -2.986125
#> Geodetic CRS: WGS 84
#> id objectid ccdd nombdep shape_length shape_area
#> 1 1 1 01 AMAZONAS 13.059047 3.199147
#> 2 2 2 02 ANCASH 11.788249 2.954697
#> 3 3 3 03 APURIMAC 7.730154 1.765933
#> 4 4 4 04 AREQUIPA 17.459435 5.330125
#> 5 5 5 05 AYACUCHO 17.127166 3.643705
#> 6 6 6 06 CAJAMARCA 12.540288 2.688386
#> geom
#> 1 MULTIPOLYGON (((-77.81399 -...
#> 2 MULTIPOLYGON (((-77.64697 -...
#> 3 MULTIPOLYGON (((-73.74655 -...
#> 4 MULTIPOLYGON (((-71.98109 -...
#> 5 MULTIPOLYGON (((-74.34843 -...
#> 6 MULTIPOLYGON (((-78.70034 -...
