ipeaGIT / geobr
- пятница, 14 февраля 2020 г. в 00:19:45
R
Easy access to official spatial data sets of Brazil in R (and soon in Python too)

geobr is a computational package to download official spatial data sets of Brazil. The package includes a wide range of geospatial data as simple features or geopackages, available at various geographic scales and for various years with harmonized attributes, projection and topology (see detailed list of available data sets below).
The package is currently available in R. The Python version is under development.
| R | Python |
|---|---|
| (under development) |
# From CRAN
install.packages("geobr")
library(geobr)
# or use the development version with latest features
utils::remove.packages('geobr')
devtools::install_github("ipeaGIT/geobr", subdir = "r-package")
library(geobr)obs. If you use Linux, you need to install a couple dependencies before installing the libraries sf and geobr. More info here.
under developmentobs. If you use Linux, you need to install a couple dependencies before installing the libraries sf and geobr. More info here.
The syntax of all geobr functions operate one the same logic so it becomes intuitive to download any data set using a single line of code. Like this:
# Read specific municipality at a given year
mun <- read_municipality(code_muni=1200179, year=2017)
# Read all municipalities of given state at a given year
mun <- read_municipality(code_muni=33, year=2010) # or
mun <- read_municipality(code_muni="RJ", year=2010)
# Read all municipalities in the country at a given year
mun <- read_municipality(code_muni="all", year=2018)More examples here and in the intro Vignette
| Function | Geographies available | Years available | Source |
|---|---|---|---|
read_country |
Country | 1872, 1900, 1911, 1920, 1933, 1940, 1950, 1960, 1970, 1980, 1991, 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018 | IBGE |
read_region |
Region | 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018 | IBGE |
read_state |
States | 1872, 1900, 1911, 1920, 1933, 1940, 1950, 1960, 1970, 1980, 1991, 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018 | IBGE |
read_meso_region |
Meso region | 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018 | IBGE |
read_micro_region |
Micro region | 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018 | IBGE |
read_intermediate_region |
Intermediate region | 2017 | IBGE |
read_immediate_region |
Immediate region | 2017 | IBGE |
read_municipality |
Municipality | 1872, 1900, 1911, 1920, 1933, 1940, 1950, 1960, 1970, 1980, 1991, 2000, 2001, 2005, 2007, 2010, 2013, 2014, 2015, 2016, 2017, 2018 | IBGE |
read_weighting_area |
Census weighting area (área de ponderação) | 2010 | IBGE |
read_census_tract |
Census tract (setor censitário) | 2000, 2010 | IBGE |
read_statistical_grid |
Statistical Grid of 200 x 200 meters | 2010 | IBGE |
read_health_facilities |
Health facilities | 2015 | CNES, DataSUS |
read_indigenous_land |
Indigenous lands | 201907 | FUNAI |
read_biomes |
Biomes | 2004, 2019 | IBGE |
read_disaster_risk_area |
Disaster risk areas | 2010 | CEMADEN and IBGE |
read_amazon |
Brazil's Legal Amazon | 2012 | MMA |
read_conservation_units |
Environmental Conservation Units | 201909 | MMA |
read_urban_area |
Urban footprints | 2005, 2015 | IBGE |
read_semiarid |
Semi Arid region | 2005, 2017 | IBGE |
read_metro_area (dev) |
Metropolitan areas | 1970, 2001, 2002, 2003, 2005, 2010, 2013, 2014, 2015, 2016, 2017, 2018 | IBGE |
| Function | Action |
|---|---|
list_geobr (dev) |
List all datasets available in the geobr package |
lookup_muni (dev) |
Look up municipality codes by their name, or the other way around |
grid_state_correspondence_table |
Loads a correspondence table indicating what quadrants of IBGE's statistical grid intersect with each state |
| ... | ... |
Note 1. Data sets and Functions marked with "dev" are only available in the development version of geobr.
Note 2. All datasets use geodetic reference system "SIRGAS2000", CRS(4674). Most data sets are available at scale 1:250,000 (see documentation for details).
| Geography | Years available | Source |
|---|---|---|
read_census_tract |
2007 | IBGE |
| Longitudinal Database* of municipalities | various years | IBGE |
| Longitudinal Database* of micro regions | various years | IBGE |
| Longitudinal Database* of Census tracts | various years | IBGE |
| Schools | 2019 | School Census (Inep) |
| Municipality seats (sedes municipais) | various years | IBGE |
| ... | ... | ... |
'*' Longitudinal Database refers to áreas mínimas comparáveis (AMCs)
If you would like to contribute to geobr and add new functions or data sets, please check this guide to propose your contribution.
As of today, there are two other R packages with similar functionalities: simplefeaturesbr and brazilmaps. The geobr package has a few advantages when compared to these other packages, including for example:

Original shapefiles are created by official government institutions. The geobr package is developed by a team at the Institute for Applied Economic Research (Ipea), Brazil. If you want to cite this package, you can cite it as: