geobr

Easy access to official spatial data sets of Brazil in R and Python

https://github.com/ipeagit/geobr

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.3%) to scientific vocabulary

Keywords

brazil datasets geopackage geopandas python r rstats sf shapefile spatial-data

Keywords from Contributors

public-transport publictransport interactive book transport-accessibility stack serializer tree-sitter packaging interface
Last synced: 6 months ago · JSON representation

Repository

Easy access to official spatial data sets of Brazil in R and Python

Basic Info
Statistics
  • Stars: 867
  • Watchers: 28
  • Forks: 120
  • Open Issues: 50
  • Releases: 21
Topics
brazil datasets geopackage geopandas python r rstats sf shapefile spatial-data
Created almost 7 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing

README.md

geobr: Download Official Spatial Data Sets of Brazil

logo logo

geobr is a computational package to download official spatial data sets of Brazil. The package includes a wide range of geospatial data in geopackage format (like shapefiles but better), 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 and Python.

| R | Python | Repo| |-----|-----|----| | CRAN/METACRAN Version
CRAN/METACRAN Total downloads
CRAN/METACRAN downloads per month
Codecov test coverage
Lifecycle: stable
R build status | PyPI version
Downloads
Downloads
Lifecycle: maturing
Python build status |GitHub stars

Project Status: Active – The project has reached a stable, usable state and is being actively developed. |

Installation R

```R

From CRAN

install.packages("geobr") library(geobr)

or use the development version with latest features

utils::remove.packages('geobr') remotes::install_github("ipeaGIT/geobr", subdir = "r-package") library(geobr) `` obs. If you use **Linux**, you need to install a couple dependencies before installing the librariessfandgeobr`. More info here.

Installation Python

bash pip install geobr Windows users:

bash conda create -n geo_env conda activate geo_env conda config --env --add channels conda-forge conda config --env --set channel_priority strict conda install python=3 geopandas pip install geobr

Basic Usage

The syntax of all geobr functions operate on the same logic so it becomes intuitive to download any data set using a single line of code. Like this:

R, reading the data as an sf object

```R library(geobr)

Read specific municipality at a given year

mun <- readmunicipality(codemuni=1200179, year=2017)

Read all municipalities of given state at a given year

mun <- readmunicipality(codemuni=33, year=2010) # or mun <- readmunicipality(codemuni="RJ", year=2010)

Read all municipalities in the country at a given year

mun <- readmunicipality(codemuni="all", year=2018) ``` More examples in the intro Vignette

Python, reading the data as a geopandas object

```python from geobr import read_municipality

Read specific municipality at a given year

mun = readmunicipality(codemuni=1200179, year=2017)

Read all municipalities of given state at a given year

mun = readmunicipality(codemuni=33, year=2010) # or mun = readmunicipality(codemuni="RJ", year=2010)

Read all municipalities in the country at a given year

mun = readmunicipality(codemuni="all", year=2018) ``` More examples here

Available datasets:

:point_right: All datasets use geodetic reference system "SIRGAS2000", CRS(4674).

|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, 2019, 2020 | IBGE | |read_region| Region | 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 | IBGE | |read_state| States | 1872, 1900, 1911, 1920, 1933, 1940, 1950, 1960, 1970, 1980, 1991, 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 | IBGE | |read_meso_region| Meso region | 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 | IBGE | |read_micro_region| Micro region | 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 | IBGE | |read_intermediate_region| Intermediate region | 2017, 2019, 2020 | IBGE | |read_immediate_region| Immediate region | 2017, 2019, 2020 | 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, 2019, 2020, 2021, 2022, 2023, 2024 | IBGE | |read_municipal_seat| Municipality seats (sedes municipais) | 1872, 1900, 1911, 1920, 1933, 1940, 1950, 1960, 1970, 1980, 1991, 2010 | IBGE | |read_weighting_area| Census weighting area (área de ponderação) | 2010 | IBGE | |read_census_tract| Census tract (setor censitário) | 2000, 2010, 2017, 2019, 2020 | IBGE | |read_statistical_grid | Statistical Grid of 200 x 200 meters | 2010 | IBGE | |read_metro_area | Metropolitan areas | 1970, 2001, 2002, 2003, 2005, 2010, 2013, 2014, 2015, 2016, 2017, 2018 | IBGE | |read_urban_area | Urban footprints | 2005, 2015 | IBGE | |read_amazon | Brazil's Legal Amazon | 2012 | MMA | |read_biomes | Biomes | 2004, 2019 | IBGE | |read_conservation_units | Environmental Conservation Units | 201909 | MMA | |read_disaster_risk_area | Disaster risk areas | 2010 | CEMADEN and IBGE | |read_indigenous_land | Indigenous lands | 201907, 202103 | FUNAI | |read_semiarid | Semi Arid region | 2005, 2017, 2021, 2022 | IBGE | |read_health_facilities | Health facilities | 201505, 202303 | CNES, DataSUS | |read_health_region | Health regions and macro regions | 1991, 1994, 1997, 2001, 2005, 2013 | DataSUS | |read_neighborhood | Neighborhood limits | 2010 | IBGE | |read_schools | Schools | 2020, 2023 | INEP | |read_comparable_areas | Historically comparable municipalities, aka Áreas mínimas comparáveis (AMCs) | 1872, 1900, 1911, 1920, 1933, 1940, 1950, 1960, 1970, 1980, 1991, 2000, 2010 | IBGE | |read_urban_concentrations | Urban concentration areas (concentrações urbanas) | 2015 | IBGE | |read_pop_arrangements | Population arrangements (arranjos populacionais) | 2015 | IBGE |

Other functions:

| Function | Action| |-----|-----| | list_geobr | List all datasets available in the geobr package | |lookup_muni| 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 | | cep_to_state | Determine the state of a given CEP postal code | | ... | ... |

Note 1. Data sets and Functions marked with "dev" are only available in the development version of geobr.

Note 2. Most data sets are available at scale 1:250,000 (see documentation for details).

Coming soon:

| Geography | Years available | Source | |-----|-----|-----| |read_census_tract | 2007 | IBGE | | Longitudinal Database* of micro regions | various years | IBGE | | Longitudinal Database* of Census tracts | various years | IBGE | | ... | ... | ... |

'*' Longitudinal Database refers to áreas mínimas comparáveis (AMCs)

Contributing to geobr

If you would like to contribute to geobr and add new functions or data sets, please check this guide to propose your contribution.


Related projects

As of today, there is another R package with similar functionalities: simplefeaturesbr. The geobr package has a few advantages when compared to simplefeaturesbr, including for example: - A same syntax structure across all functions, making the package very easy and intuitive to use - Access to a wider range of official spatial data sets, such as states and municipalities, but also macro-, meso- and micro-regions, weighting areas, census tracts, urbanized areas, etc - Access to shapefiles with updated geometries for various years - Harmonized attributes and geographic projections across geographies and years - Option to download geometries with simplified borders for fast rendering - Stable version published on CRAN for R users, and on PyPI for Python users

Similar packages for other countries/continents


Credits ipea

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:

  • Pereira, R.H.M.; Gonçalves, C.N.; et. all (2019) geobr: Loads Shapefiles of Official Spatial Data Sets of Brazil. GitHub repository - https://github.com/ipeaGIT/geobr.

Owner

  • Name: IpeaDIRUR
  • Login: ipeaGIT
  • Kind: organization

GitHub Events

Total
  • Issues event: 23
  • Watch event: 64
  • Issue comment event: 43
  • Push event: 19
  • Pull request review event: 1
  • Pull request event: 5
  • Fork event: 3
  • Create event: 13
Last Year
  • Issues event: 23
  • Watch event: 64
  • Issue comment event: 43
  • Push event: 19
  • Pull request review event: 1
  • Pull request event: 5
  • Fork event: 3
  • Create event: 13

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 4,105
  • Total Committers: 31
  • Avg Commits per committer: 132.419
  • Development Distribution Score (DDS): 0.174
Past Year
  • Commits: 45
  • Committers: 6
  • Avg Commits per committer: 7.5
  • Development Distribution Score (DDS): 0.4
Top Committers
Name Email Commits
rafapereirabr r****r@g****m 3,389
CaioNG c****s@i****r 108
IgorNascimento i****n@g****m 106
joaoc j****a@g****m 90
Pauloaraujoo h****o@g****m 80
PedroJorge 5****7 37
rafapereirabr r****r@g****m 34
Babisan08 b****t@g****m 34
Barbara Santiago Pedreira da Costa B****3@i****r 32
pedro-andrade-inpe p****e@i****r 32
Alandasilva a****1@g****m 27
Joaoc j****m@i****g 21
rodrigoarruda14 r****4@g****m 16
Vitor Sousa 3****2 14
Guilherme Duarte Carvalho g****r@g****m 12
cavedo95 j****o@g****m 12
CaioNG c****8@g****m 10
bafurtado f****b@g****m 9
Alessandro Samuel-Rosa a****a@g****m 7
dependabot[bot] 4****] 7
jvfe j****v@g****m 6
Kauê Braga k****0@g****m 5
Felipe Germanos 4****s 4
Julio Trecenti j****i@g****m 3
joaoc j****c@i****l 3
Daniel Herszenhut d****z@g****m 2
Augusto Herrmann a****b@h****h 1
Jim Hester j****r@g****m 1
Marcelo Albuquerque m****e@g****m 1
aspeddro p****o@g****m 1
and 1 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 147
  • Total pull requests: 37
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 98
  • Total pull request authors: 14
  • Average comments per issue: 3.5
  • Average comments per pull request: 0.97
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 7
Past Year
  • Issues: 19
  • Pull requests: 6
  • Average time to close issues: 9 days
  • Average time to close pull requests: about 5 hours
  • Issue authors: 17
  • Pull request authors: 3
  • Average comments per issue: 1.63
  • Average comments per pull request: 0.5
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • rafapereirabr (29)
  • JoaoCarabetta (6)
  • tp-duarte (3)
  • ruanstaffuzza (2)
  • GoulartNogueira (2)
  • MatthieuStigler (2)
  • theiostream (2)
  • GitHunter0 (2)
  • brunomioto (2)
  • ariaker (2)
  • gustavoalcantara (2)
  • schmert (2)
  • dhersz (2)
  • augustogeog (2)
  • pedro-andrade-inpe (2)
Pull Request Authors
  • dependabot[bot] (14)
  • vss-2 (11)
  • JoaoCarabetta (9)
  • popogis24 (4)
  • PedroJorge7 (2)
  • olivroy (2)
  • aspeddro (1)
  • theiostream (1)
  • jimhester (1)
  • GoulartNogueira (1)
  • rafapereirabr (1)
  • valdyjunior (1)
  • aneisse (1)
  • mironenkoasja (1)
Top Labels
Issue Labels
python dev (13) priority (11) new Data request (11) python priority (8) data fix (7) help wanted (3) data update (3) Extension (2) python issue (2) R dev (1) bug (1) enhancement (1) v2.0 (1)
Pull Request Labels
dependencies (14)

Packages

  • Total packages: 4
  • Total downloads:
    • cran 3,388 last-month
    • pypi 4,713 last-month
  • Total dependent packages: 3
    (may contain duplicates)
  • Total dependent repositories: 11
    (may contain duplicates)
  • Total versions: 59
  • Total maintainers: 3
pypi.org: geobr

geobr: Download Official Spatial Data Sets of Brazil

  • Versions: 16
  • Dependent Packages: 1
  • Dependent Repositories: 7
  • Downloads: 4,713 Last month
Rankings
Stargazers count: 2.3%
Dependent packages count: 3.3%
Average: 4.0%
Downloads: 4.2%
Forks count: 4.4%
Dependent repos count: 5.7%
Maintainers (2)
Last synced: 6 months ago
proxy.golang.org: github.com/ipeagit/geobr
  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
proxy.golang.org: github.com/ipeaGIT/geobr
  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
cran.r-project.org: geobr

Download Official Spatial Data Sets of Brazil

  • Versions: 19
  • Dependent Packages: 2
  • Dependent Repositories: 4
  • Downloads: 3,388 Last month
Rankings
Stargazers count: 0.4%
Forks count: 0.5%
Average: 7.6%
Downloads: 8.7%
Dependent packages count: 13.6%
Dependent repos count: 14.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

r-package/DESCRIPTION cran
  • R >= 3.5.0 depends
  • curl * imports
  • data.table * imports
  • httr >= 1.4.1 imports
  • sf >= 0.9 imports
  • utils * imports
  • covr * suggests
  • dplyr >= 0.8 suggests
  • ggplot2 >= 3.3.1 suggests
  • knitr * suggests
  • rmarkdown >= 2.6 suggests
  • testthat * suggests
python-package/pyproject.toml pypi
  • geopandas ^0.7.0
  • shapely ^1.7.0
python-package/requirements-dev.txt pypi
  • Shapely ==1.7.0 development
  • black * development
  • fire * development
  • geopandas ==0.7.0 development
  • jinja2 >=2.11.3 development
  • lxml * development
  • pytest * development
  • requests ==2.20.0 development
  • twine * development
python-package/requirements.txt pypi
  • Shapely ==1.7.0
  • geopandas ==0.7.0
  • jinja2 >=2.11.3
  • lxml *
  • requests ==2.20.0