Skip to contents

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

A sf object.

Examples

# \donttest{
library(geoidep)
dist <- get_districts(show_progress = FALSE)
head(dist)
#> Simple feature collection with 6 features and 12 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -73.6546 ymin: -14.08649 xmax: -73.02175 ymax: -13.70798
#> Geodetic CRS:  WGS 84
#>   id OBJECTID UBIGEO CCDD CCPP CCDI  NOMBDEP    NOMBPROV
#> 1  1        1 030220   03   02   20 APURIMAC ANDAHUAYLAS
#> 2  2        2 030415   03   04   15 APURIMAC    AYMARAES
#> 3  3        3 030409   03   04   09 APURIMAC    AYMARAES
#> 4  4        4 030214   03   02   14 APURIMAC ANDAHUAYLAS
#> 5  5        5 030206   03   02   06 APURIMAC ANDAHUAYLAS
#> 6  6        6 030404   03   04   04 APURIMAC    AYMARAES
#>                   NOMBDIST     CAPITAL SHAPE_Length  SHAPE_Area
#> 1      JOSE MARIA ARGUEDAS HUANCABAMBA    0.5703507 0.014648915
#> 2                   TINTAY      TINTAY    0.7063312 0.011908124
#> 3                    LUCRE       LUCRE    0.5536897 0.008678206
#> 4 SAN MIGUEL DE CHACCRAMPA  CHACCRAMPA    0.4027041 0.007104229
#> 5                  HUAYANA     HUAYANA    0.5634482 0.007974308
#> 6               CHAPIMARCA  CHAPIMARCA    0.6308316 0.017072690
#>                             geom
#> 1 MULTIPOLYGON (((-73.37071 -...
#> 2 MULTIPOLYGON (((-73.17529 -...
#> 3 MULTIPOLYGON (((-73.24364 -...
#> 4 MULTIPOLYGON (((-73.63057 -...
#> 5 MULTIPOLYGON (((-73.51096 -...
#> 6 MULTIPOLYGON (((-73.04322 -...
# }