| Title: | Download Official Spatial Data Sets of Brazil |
|---|---|
| Description: | Easy access to official spatial data sets of Brazil. The package offers a wide range of spatial data sets available at various geographic scales and for various years with harmonized attributes, projection and fixed topology. All functions allow for seamless integration sf, DuckDB and Arrow. |
| Authors: | Rafael H. M. Pereira [aut, cre] (ORCID: <https://orcid.org/0000-0003-2125-7465>), Rogério Jerônimo Barbosa [aut], Caio Nogueira Goncalves [ctb], Cecilia do Lago [ctb], Filipe Cavalcanti [ctb], Arthur Bazolli [ctb], Lucas Gelape [ctb], Rafael Lopes [ctb], Vinicius Oike [ctb], Paulo Henrique Fernandes de Araujo [ctb], Guilherme Duarte Carvalho [ctb], Rodrigo Almeida de Arruda [ctb], Igor Nascimento [ctb], Barbara Santiago Pedreira da Costa [ctb], Welligtton Silva Cavedo [ctb], Pedro R. Andrade [ctb], Alan da Silva [ctb], Carlos Kauê Vieira Braga [ctb], Carl Schmertmann [ctb], Alessandro Samuel-Rosa [ctb], Daniel Ferreira [ctb], Marcus Saraiva [ctb], Beatriz Milz [ctb] (ORCID: <https://orcid.org/0000-0002-3064-4486>), ITpS - Instituto Todos pela Saúde [fnd], Ipea - Institue for Applied Economic Research [cph, fnd] |
| Maintainer: | Rafael H. M. Pereira <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.0.0 |
| Built: | 2026-05-22 19:08:35 UTC |
| Source: | https://github.com/ipeaGIT/geobr |
Zips codes in Brazil are known as CEP, the abbreviation for postal code
address. CEPs in Brazil are 8 digits long, with the format 'xxxxx-xxx'.
cep_to_state(cep)cep_to_state(cep)
cep |
A character string with 8 digits in the format |
A character string with a state abbreviation.
uf <- cep_to_state(cep = '69900-000') # Or: uf <- cep_to_state(cep = '69900000')uf <- cep_to_state(cep = '69900-000') # Or: uf <- cep_to_state(cep = '69900000')
Built-in dataset
name_state: Title-case name of state (character)
abbrev_state: Two-letter uppercase abbreviation of a state
code_grid: Unique code of each quadrant of IBGE's statistical grid
data(grid_state_correspondence_table)data(grid_state_correspondence_table)
A data frame sf with 139 rows and 3 columns
correspondence table indicating what quadrants of IBGE's statistical grid intersect with each Brazilian state
Last updated 2021-o3-21
Returns a data frame with all data sets available in the geobr package
list_geobr(wide = TRUE)list_geobr(wide = TRUE)
wide |
Whether the the output data frame should come in wide ( |
A data.frame
df <- list_geobr()df <- list_geobr()
Input a municipality name or code and get the names and codes of the municipality.
lookup_muni(year, name_muni = NULL, code_muni = NULL)lookup_muni(year, name_muni = NULL, code_muni = NULL)
year |
Numeric. Year of the data in YYYY format. It defaults to |
name_muni |
The municipality name to be looked up. |
code_muni |
The municipality code to be looked up. |
Only available from 2010 Census data so far
A data.frame with 13 columns identifying the geographies information
of that municipality.
A data.frame
# Look for municipality Rio de Janeiro mun <- lookup_muni( name_muni = "Rio de Janeiro", year = 2022 ) # Look for a given municipality code mun <- lookup_muni( code_muni = 3304557, year = 2022 ) # Get the lookup table for all municipalities mun_all <- lookup_muni( name_muni = "all", year = 2022 ) # Or: mun_all <- lookup_muni( code_muni = "all", year = 2022 )# Look for municipality Rio de Janeiro mun <- lookup_muni( name_muni = "Rio de Janeiro", year = 2022 ) # Look for a given municipality code mun <- lookup_muni( code_muni = 3304557, year = 2022 ) # Get the lookup table for all municipalities mun_all <- lookup_muni( name_muni = "all", year = 2022 ) # Or: mun_all <- lookup_muni( code_muni = "all", year = 2022 )
This data set covers the whole of Brazil's Legal Amazon as defined in the federal law n. 12.651/2012). The original data comes from the Brazilian Ministry of Environment (MMA) and can be found at "http://mapas.mma.gov.br/i3geo/datadownload.htm".
read_amazon( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_amazon( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read Brazilian Legal Amazon a <- read_amazon(year = 2024)# Read Brazilian Legal Amazon a <- read_amazon(year = 2024)
This data set includes polygons of all biomes present in the Brazilian territory and coastal area. Data comes from IBGE. More information at https://www.ibge.gov.br/geociencias/cartas-e-mapas/informacoes-ambientais/15842-biomas.html
read_biomes( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_biomes( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read biomes b <- read_biomes(year = 2025)# Read biomes b <- read_biomes(year = 2025)
This function downloads either a spatial sf object with the location of the
municipal seats (sede dos municipios) of state capitals, or a data.frame
with the names and codes of state capitals. Data downloaded for the latest
available year.
read_capitals(output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE)read_capitals(output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE)
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read spatial data with the municipal seats of state capitals capitals_sf <- read_capitals(output = "sf")# Read spatial data with the municipal seats of state capitals capitals_sf <- read_capitals(output = "sf")
Data of census tracts (setores censitários) of the Brazilian Population Census
read_census_tract( year, code_tract, zone = "urban", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_census_tract( year, code_tract, zone = "urban", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_tract |
The 7-digit code of a Municipality. If the two-digit code
or a two-letter uppercase abbreviation of a state is passed, (e.g. 33
or "RJ") the function will load all census tracts of that state. If
|
zone |
For census tracts before 2010, 'urban' and 'rural' census tracts are separate data sets. |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read all census tracts of a state at a given year c <- read_census_tract(year = 2022, code_tract = "DF") # Read all census tracts of a municipality at a given year c <- read_census_tract(year = 2022, code_tract = 5201108) # Read all census tracts of the country at a given year c <- read_census_tract(year = 2022, code_tract = "all") # Read rural census tracts for years before 2007 c <- read_census_tract( year = 2000, code_tract = 5201108, zone = "rural" )# Read all census tracts of a state at a given year c <- read_census_tract(year = 2022, code_tract = "DF") # Read all census tracts of a municipality at a given year c <- read_census_tract(year = 2022, code_tract = 5201108) # Read all census tracts of the country at a given year c <- read_census_tract(year = 2022, code_tract = "all") # Read rural census tracts for years before 2007 c <- read_census_tract( year = 2000, code_tract = 5201108, zone = "rural" )
This function downloads the shape file of minimum comparable area of
municipalities, known in Portuguese as 'Areas minimas comparaveis (AMCs)'.
The data is available for any combination of census years between 1872-2010.
These data sets are generated based on the Stata code originally developed by
Ehrl (2017) doi:10.1590/0101-416147182phe, and translated into R by the
geobr team.
read_comparable_areas( start_year = 1970, end_year = 2010, simplified = TRUE, showProgress = TRUE, cache = TRUE, verbose = TRUE )read_comparable_areas( start_year = 1970, end_year = 2010, simplified = TRUE, showProgress = TRUE, cache = TRUE, verbose = TRUE )
start_year |
Numeric. Start year to the period in the YYYY format.
Defaults TO |
end_year |
Numeric. End year to the period in the YYYY format. Defaults
to |
simplified |
Logic |
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
These data sets are generated based on the original Stata code developed by Philipp Ehrl. If you use these data, please cite:
Ehrl, P. (2017). Minimum comparable areas for the period 1872-2010: an aggregation of Brazilian municipalities. Estudos Econômicos (São Paulo), 47(1), 215-229. https://doi.org/10.1590/0101-416147182phe
An "sf" "data.frame" OR an ArrowObject
amc <- read_comparable_areas(start_year=1970, end_year=2010)amc <- read_comparable_areas(start_year=1970, end_year=2010)
This data set covers the whole of Brazil and it includes the polygons of all conservation units present in Brazilian territory. The original data and data dictionary can be found comes from MMA and can be found at "https://dados.mma.gov.br/dataset/unidadesdeconservacao".
read_conservation_units( date, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_conservation_units( date, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
date |
Numeric. Date of the data in YYYYMM format. It defaults to |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read conservation_units uc <- read_conservation_units(date = 202503)# Read conservation_units uc <- read_conservation_units(date = 202503)
National borders
read_country( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_country( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read specific year br_1872 <- read_country(year = 1872) br_2025 <- read_country(year = 2025)# Read specific year br_1872 <- read_country(year = 1872) br_2025 <- read_country(year = 2025)
This function reads the the official data of disaster risk areas in Brazil (currently only available for 2010). It specifically focuses on geodynamic and hydro-meteorological disasters capable of triggering landslides and floods. The data set covers the whole country. Each risk area polygon (known as 'BATER') has unique code id (column 'geo_bater'). The data set brings information on the extent to which the risk area polygons overlap with census tracts and block faces (column "acuracia") and number of ris areas within each risk area (column 'num'). Original data were generated by IBGE and CEMADEN. For more information about the methodology, see deails at https://www.ibge.gov.br/geociencias/organizacao-do-territorio/tipologias-do-territorio/21538-populacao-em-areas-de-risco-no-brasil.html
read_disaster_risk_area( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_disaster_risk_area( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read all disaster risk areas in an specific year d <- read_disaster_risk_area(year = 2010) # Read disaster risk areas in a given municipality d <- read_disaster_risk_area(year = 2010, code_muni = 2927408) # Read disaster risk areas in a given state d <- read_disaster_risk_area(year = 2010, code_muni = "AC")# Read all disaster risk areas in an specific year d <- read_disaster_risk_area(year = 2010) # Read disaster risk areas in a given municipality d <- read_disaster_risk_area(year = 2010, code_muni = 2927408) # Read disaster risk areas in a given state d <- read_disaster_risk_area(year = 2010, code_muni = "AC")
This function reads the official data on favelas and urban communities (favelas e comunidades urbanas) of Brazil. Original data from the Institute of Geography and Statistics (IBGE) For more information about the methodology, see details at https://biblioteca.ibge.gov.br/visualizacao/livros/liv102134.pdf
read_favela( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_favela( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read all favelas of Brazil n <- read_favela(year = 2022) # Read all favelas of a given municipality n <- read_favela(year = 2022, code_muni = 2927408) # Read all favelas of a given state n <- read_favela(year = 2022, code_muni = "RJ")# Read all favelas of Brazil n <- read_favela(year = 2022) # Read all favelas of a given municipality n <- read_favela(year = 2022, code_muni = 2927408) # Read all favelas of a given state n <- read_favela(year = 2022, code_muni = "RJ")
Data comes from the National Registry of Health Facilities (Cadastro
Nacional de Estabelecimentos de Saude - CNES), originally collected by the
Brazilian Ministry of Health.
The spatial coordinates used in geobr are a combination of the coordinates
produced by the original data producer and the coordinates found via geocoding
with the geocodebr package https://CRAN.R-project.org/package=geocodebr.
Whenever the distance between the coordinates from both sources is smaller than
800 meters, geobr uses coordinates from the data producer. When the distance
between the two sources is greater than 800 meters and the results from
geocodebr have a precision level finer than 800 meters, geobr uses the
coordinates from geocodebr. When the coordinates from the original source are
missing, geobr also uses geocodebr coordinates, regardless of precision level.
The source of the spatial coordinates used in each observation is registered
in the data in a specific column coords_source. Additional columns
indicating the precision level of geocodebr geocoding are also included in
the data.
read_health_facilities( date, code_muni = "all", output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_health_facilities( date, code_muni = "all", output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
date |
Numeric. Date of the data in YYYYMM format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read health facilities of a given state h <- read_health_facilities( date = 202601, code_muni = "PA" ) # Read all health facilities of the whole country h <- read_health_facilities(date = 202601)# Read health facilities of a given state h <- read_health_facilities( date = 202601, code_muni = "PA" ) # Read all health facilities of the whole country h <- read_health_facilities(date = 202601)
Health regions are used to guide the the regional and state planning of health services. Macro health regions, in particular, are used to guide the planning of high complexity #' health services. These services involve larger economics of scale and are concentrated in few municipalities because they are generally more technology intensive, costly and face shortages of specialized professionals. A macro region comprises one or more health regions.
read_health_region( year, code_state = "all", geometry_level = "municipality", macro = NULL, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_health_region( year, code_state = "all", geometry_level = "municipality", macro = NULL, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_state |
The two-digit code of a state or a two-letter uppercase
abbreviation (e.g. 33 or "RJ"). If |
geometry_level |
String. Spatial level of the output geometries. Use
|
macro |
The argument |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read municipalities with info on health regions health_muni <- read_health_region(year = 2024) # Read the geometries of micro regions health_micro <- read_health_region( year = 2024, geometry_level = "micro" ) # Read the geometries of macro regions health_macro <- read_health_region( year = 2024, geometry_level = "macro" )# Read municipalities with info on health regions health_muni <- read_health_region(year = 2024) # Read the geometries of micro regions health_micro <- read_health_region( year = 2024, geometry_level = "micro" ) # Read the geometries of macro regions health_macro <- read_health_region( year = 2024, geometry_level = "macro" )
The Immediate Geographic Areas are part of the geographic division of Brazil created after 2017 by IBGE. These regions were created to replace the "Micro Regions" division. Data at scale 1:250,000.
read_immediate_region( year, code_immediate = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_immediate_region( year, code_immediate = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_immediate |
6-digit code of an immediate region. If the two-digit
code or a two-letter uppercase abbreviation of a state is passed, (e.g.
33 or "RJ") the function will load all immediate regions of that state.
If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read an specific immediate region im <- read_immediate_region(code_immediate=110006, year = 2024) # Read immediate regions of a state im <- read_immediate_region(code_immediate="AM", year = 2024) im <- read_immediate_region(code_immediate=12, year = 2024) # Read all immediate regions of the country im <- read_immediate_region(code_immediate="all", year = 2024)# Read an specific immediate region im <- read_immediate_region(code_immediate=110006, year = 2024) # Read immediate regions of a state im <- read_immediate_region(code_immediate="AM", year = 2024) im <- read_immediate_region(code_immediate=12, year = 2024) # Read all immediate regions of the country im <- read_immediate_region(code_immediate="all", year = 2024)
The data set covers the whole of Brazil and it includes indigenous lands from all ethnic groups and at different stages of demarcation. The original data comes from the National Indian Foundation (FUNAI) and can be found at https://www.gov.br/funai/pt-br/atuacao/terras-indigenas/geoprocessamento-e-mapas. Although original data is updated monthly, the geobr package will only keep the data for a few months per year.
read_indigenous_land( year, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_indigenous_land( year, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_state |
The two-digit code of a state or a two-letter uppercase
abbreviation (e.g. 33 or "RJ"). If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read all indigenous land in an specific year i <- read_indigenous_land(year = 2025)# Read all indigenous land in an specific year i <- read_indigenous_land(year = 2025)
The intermediate Geographic Areas are part of the geographic division of Brazil created after 2017 by IBGE. These regions were created to replace the "Meso Regions" division. Data at scale 1:250,000.
read_intermediate_region( year, code_intermediate = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_intermediate_region( year, code_intermediate = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_intermediate |
4-digit code of an intermediate region. If the
two-digit code or a two-letter uppercase abbreviation of a state is
passed, (e.g. 33 or "RJ") the function will load all intermediate
regions of that state. If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read an specific intermediate region inter <- read_intermediate_region(code_intermediate = 1202, year = 2024) # Read intermediate regions of a state inter <- read_intermediate_region(code_intermediate = "AM", year = 2024) inter <- read_intermediate_region(code_intermediate = 12, year = 2024) # Read all intermediate regions of the country inter <- read_intermediate_region(code_intermediate = "all", year = 2024)# Read an specific intermediate region inter <- read_intermediate_region(code_intermediate = 1202, year = 2024) # Read intermediate regions of a state inter <- read_intermediate_region(code_intermediate = "AM", year = 2024) inter <- read_intermediate_region(code_intermediate = 12, year = 2024) # Read all intermediate regions of the country inter <- read_intermediate_region(code_intermediate = "all", year = 2024)
Data at scale 1:250,000, using Geodetic reference system "SIRGAS2000" and CRS(4674)
read_meso_region( year, code_meso = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_meso_region( year, code_meso = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_meso |
The 4-digit code of a meso region. If the two-digit code or
a two-letter uppercase abbreviation of a state is passed, (e.g. 33 or
"RJ") the function will load all meso regions of that state. If
|
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read specific meso region at a given year meso <- read_meso_region(code_meso=3301, year = 2018) # Read all meso regions of a state at a given year meso <- read_meso_region(code_meso="AM", year = 2018) meso <- read_meso_region(code_meso=12, year = 2018) # Read all meso regions of the country at a given year meso <- read_meso_region(code_meso="all", year = 2018)# Read specific meso region at a given year meso <- read_meso_region(code_meso=3301, year = 2018) # Read all meso regions of a state at a given year meso <- read_meso_region(code_meso="AM", year = 2018) meso <- read_meso_region(code_meso=12, year = 2018) # Read all meso regions of the country at a given year meso <- read_meso_region(code_meso="all", year = 2018)
The function returns the shapes of municipalities grouped by their respective metro areas. Metropolitan areas are created by each state in Brazil. The data set includes the municipalities that belong to all metropolitan areas in the country according to state legislation in each year. Original data were generated by the Brazilian Institute of Geography and Statistics (IBGE). Data at scale 1:250,000, using Geodetic reference system "SIRGAS2000" and CRS(4674).
read_metro_area( year, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_metro_area( year, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_state |
The two-digit code of a state or a two-letter uppercase
abbreviation (e.g. 33 or "RJ"). If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read all official metropolitan areas for a given year m <- read_metro_area(year = 1970) m <- read_metro_area( year = 2024, code_state = "RJ" )# Read all official metropolitan areas for a given year m <- read_metro_area(year = 1970) m <- read_metro_area( year = 2024, code_state = "RJ" )
Data at scale 1:250,000, using Geodetic reference system "SIRGAS2000" and CRS(4674)
read_micro_region( year, code_micro = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_micro_region( year, code_micro = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_micro |
5-digit code of a micro region. If the two-digit code or a
two-letter uppercase abbreviation of a state is passed, (e.g. 33 or
"RJ") the function will load all micro regions of that state. If
|
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read an specific micro region a given year micro <- read_micro_region(code_micro=11008, year=2018) # Read micro regions of a state at a given year micro <- read_micro_region(code_micro="AM", year=2018) micro <- read_micro_region(code_micro=12, year=2018) # Read all micro regions at a given year micro <- read_micro_region(code_micro="all", year=2018)# Read an specific micro region a given year micro <- read_micro_region(code_micro=11008, year=2018) # Read micro regions of a state at a given year micro <- read_micro_region(code_micro="AM", year=2018) micro <- read_micro_region(code_micro=12, year=2018) # Read all micro regions at a given year micro <- read_micro_region(code_micro="all", year=2018)
This function reads the official data on the municipal seats (sede dos municipios) of Brazil. The data brings the geographical coordinates (lat lon) of municipal seats for various years since 1872. Original data by the Brazilian Institute of Geography and Statistics (IBGE).
read_municipal_seat( year, code_muni = "all", output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_municipal_seat( year, code_muni = "all", output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read municipal seats in an specific year m <- read_municipal_seat(year = 2022)# Read municipal seats in an specific year m <- read_municipal_seat(year = 2022)
Brazilian municipalities
read_municipality( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE, keep_areas_operacionais = FALSE )read_municipality( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE, keep_areas_operacionais = FALSE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
keep_areas_operacionais |
Logic. Whether the function should keep the
polygons of Lagoas dos Patos and Lagoa Mirim in the State of Rio Grande
do Sul (considered as areas estaduais operacionais). Defaults to |
An "sf" "data.frame" OR an ArrowObject
# Read specific municipality at a given year mun <- read_municipality(code_muni = 1200179, year = 2017) # Read all municipalities of a state at a given year mun <- read_municipality(code_muni = 33, year = 2010) mun <- read_municipality(code_muni = "RJ", year = 2010) # Read all municipalities of the country at a given year mun <- read_municipality(code_muni = "all", year = 2018)# Read specific municipality at a given year mun <- read_municipality(code_muni = 1200179, year = 2017) # Read all municipalities of a state at a given year mun <- read_municipality(code_muni = 33, year = 2010) mun <- read_municipality(code_muni = "RJ", year = 2010) # Read all municipalities of the country at a given year mun <- read_municipality(code_muni = "all", year = 2018)
This data set includes the neighborhood limits of Brazilian municipalities. The data is only available for those municipalities where neighborhood information was collected in the population census. The data set is based on aggregations of the census tracts from the Brazilian census.
read_neighborhood( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_neighborhood( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read neighborhoods of Brazilian municipalities n <- read_neighborhood(year = 2022) # Read neighborhoods of two municipalities, Recife and Porto Alegre in this example r <- read_neighborhood( year = 2022, code_muni = c(2611606, 4314902) )# Read neighborhoods of Brazilian municipalities n <- read_neighborhood(year = 2022) # Read neighborhoods of two municipalities, Recife and Porto Alegre in this example r <- read_neighborhood( year = 2022, code_muni = c(2611606, 4314902) )
Data comes from the Superior Electoral Court (TSE).
The spatial coordinates used in geobr are a combination of the coordinates
produced by the original data producer and the coordinates found via geocoding
with the geocodebr package https://CRAN.R-project.org/package=geocodebr.
Whenever the distance between the coordinates from both sources is smaller than
800 meters, geobr uses coordinates from the data producer. When the distance
between the two sources is greater than 800 meters and the results from
geocodebr have a precision level finer than 800 meters, geobr uses the
coordinates from geocodebr. When the coordinates from the original source are
missing, geobr also uses geocodebr coordinates, regardless of precision level.
The source of the spatial coordinates used in each observation is registered
in the data in a specific column coords_source. Additional columns
indicating the precision level of geocodebr geocoding are also included in
the data.
read_polling_places( year, code_muni = "all", output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_polling_places( year, code_muni = "all", output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read health facilities of a given municipality h <- read_polling_places( year = 2022, code_muni = 2800308 ) # Read health facilities of a given state h <- read_polling_places( year = 2022, code_muni = "SE" ) # Read all health facilities of the whole country h <- read_polling_places(year = 2022)# Read health facilities of a given municipality h <- read_polling_places( year = 2022, code_muni = 2800308 ) # Read health facilities of a given state h <- read_polling_places( year = 2022, code_muni = "SE" ) # Read all health facilities of the whole country h <- read_polling_places(year = 2022)
This function reads the official data on the population arrangements (Arranjos Populacionais) in Brazil. Original data by the Brazilian Institute of Geography and Statistics (IBGE). More information about the methodology at https://www.ibge.gov.br/geociencias/organizacao-do-territorio/divisao-regional/15782-arranjos-populacionais-e-concentracoes-urbanas-do-brasil.html
read_pop_arrangements( year, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_pop_arrangements( year, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_state |
The two-digit code of a state or a two-letter uppercase
abbreviation (e.g. 33 or "RJ"). If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read population arrangements in an specific year pa <- read_pop_arrangements(year = 2010)# Read population arrangements in an specific year pa <- read_pop_arrangements(year = 2010)
Read data of quilombola areas officialy recognized by the Instituto Nacional
de Colonização e Reforma Agrária - INCRA. The date refers to the date when
the data was downloaded, and captures the quilombola lands recognized on that
date. More info at https://dados.gov.br/dados/conjuntos-dados/comunidades-quilombolas-certificadas.
read_quilombola_land( date, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_quilombola_land( date, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
date |
Numeric. Date of the data in YYYYMM format. It defaults to |
code_state |
The two-digit code of a state or a two-letter uppercase
abbreviation (e.g. 33 or "RJ"). If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
code_quilombo - Código da Comunidade Quilombola (para controle interno)
name_quilombo - Nome da Comunidade Quilombola
code_sr - Código da Superintendência Regional
n_process - Número do processo de titulação de terras, junto ao Instituto Nacional de Colonização e Reforma Agrária - INCRA
name_muni - Nome do Município em que está localizada
abbrev_state - Sigla da Unidade Federativa em que está localizada
code_state - Código da Unidade Federativa em que está localizada
date_recog - Data de publicação da portaria de reconhecimento pelo presidente do INCRA
date_decree_pr - Decreto da presidência da República para fins de desapropriação, por interesse social
date_decree - Data decreto de regularização do território
date_titulacao - Data da titulação das terras
code_sipra - Código no Sistema de Informações de Projetos de Reforma Agrária - SIPRA
n_family - Número de famílias
perimeter - Perímetro calculado depois da medição/demarcação (georreferenciamento) para fins de certificação
area_ha - Área em hectares
geo_scale - Escala utilizada para mapeamento
stage - Fase do processo
gov_level - Nível da esfera administrativa responsável
responsible_unit - Órgão responsável
# Read all quilombola areas in an specific date q <- read_quilombola_land(date = 202605) # Read the quilombola areas in an given state ba <- read_quilombola_land(date = 202605, code_state = "BA")# Read all quilombola areas in an specific date q <- read_quilombola_land(date = 202605) # Read the quilombola areas in an given state ba <- read_quilombola_land(date = 202605, code_state = "BA")
Brazil macro regions
read_region( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_region( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read specific year reg <- read_region(year = 2023)# Read specific year reg <- read_region(year = 2023)
Data comes from the School Census and Catalogue of Schools, organized by the
National Institute for Educational Studies and Research Anisio Teixeira (INEP).
More information available at https://www.gov.br/inep/pt-br/acesso-a-informacao/dados-abertos/inep-data/catalogo-de-escolas/.
The spatial coordinates used in geobr are a combination of the coordinates
produced by the original data producer and the coordinates found via geocoding
with the geocodebr package https://CRAN.R-project.org/package=geocodebr.
Whenever the distance between the coordinates from both sources is smaller than
800 meters, geobr uses coordinates from the data producer. When the distance
between the two sources is greater than 800 meters and the results from
geocodebr have a precision level finer than 800 meters, geobr uses the
coordinates from geocodebr. When the coordinates from the original source are
missing, geobr also uses geocodebr coordinates, regardless of precision level.
The source of the spatial coordinates used in each observation is registered
in the data in a specific column coords_source. Additional columns
indicating the precision level of geocodebr geocoding are also included in
the data.
read_schools( year, code_muni = "all", output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_schools( year, code_muni = "all", output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read all schools in the country s <- read_schools(year = 2020) # Read all schools in a given state s <- read_schools( year = 2020, code_muni = "AC" ) # Read all schools in a given municipality s <- read_schools( year = 2020, code_muni = 1200401 )# Read all schools in the country s <- read_schools(year = 2020) # Read all schools in a given state s <- read_schools( year = 2020, code_muni = "AC" ) # Read all schools in a given municipality s <- read_schools( year = 2020, code_muni = 1200401 )
This data set returns all the municipalities which are legally included in the Brazilian Semiarid, following changes in the national legislation. The original data comes from the Brazilian Institute of Geography and Statistics (IBGE) and can be found at https://www.ibge.gov.br/geociencias/cartas-e-mapas/mapas-regionais/15974-semiarido-brasileiro.html
read_semiarid( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_semiarid( year, simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# read Brazilian semiarid sa <- read_semiarid(year = 2022)# read Brazilian semiarid sa <- read_semiarid(year = 2022)
Brazilian states
read_state( year = NULL, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_state( year = NULL, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_state |
The two-digit code of a state or a two-letter uppercase
abbreviation (e.g. 33 or "RJ"). If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read all states at a given year ufs <- read_state(code_state="all", year = 2025) # Read specific state at a given year uf <- read_state(code_state="SC", year = 2025) # Read specific state at a given year uf <- read_state(code_state=12, year = 2025)# Read all states at a given year ufs <- read_state(code_state="all", year = 2025) # Read specific state at a given year uf <- read_state(code_state="SC", year = 2025) # Read specific state at a given year uf <- read_state(code_state=12, year = 2025)
Official gridded population estimate of Brazil.
read_statistical_grid( year, code_muni, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_statistical_grid( year, code_muni, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read the grid covering a given state at a given year grid_rio <- read_statistical_grid( year = 2022, code_muni = "RJ" ) # Read the grid covering a given municipality at a given year grid_ssalvador <- read_statistical_grid( year = 2022, code_muni = 2927408 )# Read the grid covering a given state at a given year grid_rio <- read_statistical_grid( year = 2022, code_muni = "RJ" ) # Read the grid covering a given municipality at a given year grid_ssalvador <- read_statistical_grid( year = 2022, code_muni = 2927408 )
This function reads the official data on the urban footprint of Brazilian cities. Original data by the Brazilian Institute of Geography and Statistics (IBGE) For more information about the methodology, see details at https://biblioteca.ibge.gov.br/visualizacao/livros/liv100639.pdf
read_urban_area( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_urban_area( year, code_muni = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_muni |
The 7-digit code of a municipality. If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read urban footprint of Brazilian cities in an specific year d <- read_urban_area(year = 2015)# Read urban footprint of Brazilian cities in an specific year d <- read_urban_area(year = 2015)
This function reads the official data on the urban concentration areas (Áreas de Concentração de População) in Brazil. Original data by the Brazilian Institute of Geography and Statistics (IBGE). More information about the methodology at https://www.ibge.gov.br/geociencias/organizacao-do-territorio/divisao-regional/15782-arranjos-populacionais-e-concentracoes-urbanas-do-brasil.html
read_urban_concentrations( year, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_urban_concentrations( year, code_state = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_state |
The two-digit code of a state or a two-letter uppercase
abbreviation (e.g. 33 or "RJ"). If |
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read urban concentration areas in an specific year uc <- read_urban_concentrations(year = 2010)# Read urban concentration areas in an specific year uc <- read_urban_concentrations(year = 2010)
Data of Census Weighting Areas (area de ponderação) of the Brazilian Population Census
read_weighting_area( year, code_weighting = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )read_weighting_area( year, code_weighting = "all", simplified = TRUE, output = "sf", showProgress = TRUE, cache = TRUE, verbose = TRUE )
year |
Numeric. Year of the data in YYYY format. It defaults to |
code_weighting |
The 7-digit code of a Municipality. If the two-digit code
or a two-letter uppercase abbreviation of a state is passed, (e.g. 33 or "RJ")
the function will load all weighting areas of that state. If
|
simplified |
Logic |
output |
String. Type of object returned by the function. Defaults to
|
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read the data cached
locally, which is faster. Defaults to |
verbose |
A logical. If |
An "sf" "data.frame" OR an ArrowObject
# Read specific weighting area at a given year w <- read_weighting_area( code_weighting = 5201108005004, year = 2010 ) # Read all weighting areas of a state at a given year w <- read_weighting_area( code_weighting = "DF", year = 2010 ) # Read all weighting areas of a municipality at a given year w <- read_weighting_area( code_weighting = 5201108, year = 2010 ) # Read all weighting areas of the country at a given year w <- read_weighting_area( code_weighting = "all", year = 2010 )# Read specific weighting area at a given year w <- read_weighting_area( code_weighting = 5201108005004, year = 2010 ) # Read all weighting areas of a state at a given year w <- read_weighting_area( code_weighting = "DF", year = 2010 ) # Read all weighting areas of a municipality at a given year w <- read_weighting_area( code_weighting = 5201108, year = 2010 ) # Read all weighting areas of the country at a given year w <- read_weighting_area( code_weighting = "all", year = 2010 )
Removes Brazilian islands that are approximately more than 20 km from the mainland coast. This is useful when analyses or data visualization should focus on the continental territory of Brazil and exclude distant oceanic islands.
remove_islands(x)remove_islands(x)
x |
An 'sf' object with CRS EPSG:4674. Usually an object returned from
other geobr functions, such as |
An sf data frame with the same attributes as x, but with distant
islands removed from the geometry.
library(geobr) library(sf) br <- read_country(year = 1991) br_no_islands <- remove_islands(br) plot(br)library(geobr) library(sf) br <- read_country(year = 1991) br_no_islands <- remove_islands(br) plot(br)