{"id":19856426,"url":"https://github.com/ipeagit/geobr","last_synced_at":"2025-05-14T05:02:44.412Z","repository":{"id":40516765,"uuid":"177215782","full_name":"ipeaGIT/geobr","owner":"ipeaGIT","description":"Easy access to official spatial data sets of Brazil in R and Python","archived":false,"fork":false,"pushed_at":"2025-03-13T00:19:19.000Z","size":50545,"stargazers_count":837,"open_issues_count":43,"forks_count":122,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-10T08:14:38.517Z","etag":null,"topics":["brazil","datasets","geopackage","geopandas","python","r","rstats","sf","shapefile","spatial-data"],"latest_commit_sha":null,"homepage":"https://ipeagit.github.io/geobr/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipeaGIT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-22T22:15:22.000Z","updated_at":"2025-04-02T17:27:04.000Z","dependencies_parsed_at":"2023-11-27T02:51:37.965Z","dependency_job_id":"229fa0df-983d-4e87-9002-5365ce4446a0","html_url":"https://github.com/ipeaGIT/geobr","commit_stats":{"total_commits":4016,"total_committers":32,"mean_commits":125.5,"dds":0.1683266932270916,"last_synced_commit":"59d29649ff9e7ce141eb82271d5fbd19b5fbf413"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipeaGIT%2Fgeobr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipeaGIT%2Fgeobr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipeaGIT%2Fgeobr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipeaGIT%2Fgeobr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipeaGIT","download_url":"https://codeload.github.com/ipeaGIT/geobr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248309118,"owners_count":21082151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brazil","datasets","geopackage","geopandas","python","r","rstats","sf","shapefile","spatial-data"],"created_at":"2024-11-12T14:15:29.116Z","updated_at":"2025-04-10T22:30:12.312Z","avatar_url":"https://github.com/ipeaGIT.png","language":"R","readme":"# geobr: Download Official Spatial Data Sets of Brazil \n\n\u003cimg align=\"right\" src=\"https://github.com/ipeaGIT/geobr/blob/master/r-package/man/figures/geobr_logo_b.png?raw=true\" alt=\"logo\" width=\"140\"\u003e \n\u003cimg align=\"right\" src=\"https://github.com/ipeaGIT/geobr/blob/master/r-package/man/figures/geobr_logo_y.png?raw=true\" alt=\"logo\" width=\"140\"\u003e\n\u003cp align=\"justify\"\u003egeobr 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). \u003c/p\u003e \n\n\n\n\nThe package is currently available in [**R**](https://CRAN.R-project.org/package=geobr) and [**Python**](https://pypi.org/project/geobr/).\n\n| ***R*** | ***Python*** | ***Repo***|\n|-----|-----|----|\n| [![CRAN/METACRAN Version](https://www.r-pkg.org/badges/version/geobr)](https://CRAN.R-project.org/package=geobr) \u003cbr /\u003e [![CRAN/METACRAN Total downloads](https://cranlogs.r-pkg.org/badges/grand-total/geobr?color=blue)](https://CRAN.R-project.org/package=geobr) \u003cbr /\u003e [![CRAN/METACRAN downloads per month](https://cranlogs.r-pkg.org/badges/geobr?color=yellow)](https://CRAN.R-project.org/package=geobr) \u003cbr /\u003e [![Codecov test coverage](https://codecov.io/gh/ipeaGIT/geobr/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ipeaGIT/geobr?branch=master)  \u003cbr /\u003e [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable) \u003cbr /\u003e [![R build status](https://github.com/ipeaGIT/geobr/workflows/R-CMD-check/badge.svg)](https://github.com/ipeaGIT/geobr/actions)  | [![PyPI version](https://badge.fury.io/py/geobr.svg)](https://badge.fury.io/py/geobr) \u003cbr /\u003e  [![Downloads](https://static.pepy.tech/badge/geobr)](https://pepy.tech/project/geobr) \u003cbr /\u003e  [![Downloads](https://static.pepy.tech/badge/geobr/month)](https://pepy.tech/project/geobr)  \u003cbr /\u003e [![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) \u003cbr /\u003e [![Python build status](https://github.com/ipeaGIT/geobr/workflows/Python-CMD-check/badge.svg)](https://github.com/ipeaGIT/geobr/actions) |\u003cimg alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/ipeaGIT/geobr.svg?color=orange\"\u003e \u003cbr /\u003e \u003cbr /\u003e  [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) |\n\n\n\n\n## Installation R\n\n```R\n# From CRAN\ninstall.packages(\"geobr\")\nlibrary(geobr)\n\n# or use the development version with latest features\nutils::remove.packages('geobr')\nremotes::install_github(\"ipeaGIT/geobr\", subdir = \"r-package\")\nlibrary(geobr)\n```\nobs. If you use **Linux**, you need to install a couple dependencies before installing the libraries `sf` and `geobr`. [More info here](https://github.com/r-spatial/sf#linux).\n\n\n\n## Installation Python\n```bash\npip install geobr\n```\n*Windows users:*  \n\n```bash\nconda create -n geo_env\nconda activate geo_env  \nconda config --env --add channels conda-forge  \nconda config --env --set channel_priority strict  \nconda install python=3 geopandas  \npip install geobr\n```\n\n# Basic Usage\n\nThe 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:\n\n## R, reading the data as an `sf` object\n```R\nlibrary(geobr)\n\n# Read specific municipality at a given year\nmun \u003c- read_municipality(code_muni=1200179, year=2017)\n\n# Read all municipalities of given state at a given year\nmun \u003c- read_municipality(code_muni=33, year=2010) # or\nmun \u003c- read_municipality(code_muni=\"RJ\", year=2010)\n\n# Read all municipalities in the country at a given year\nmun \u003c- read_municipality(code_muni=\"all\", year=2018)\n```\nMore examples in the [intro Vignette](https://cran.r-project.org/web/packages/geobr/vignettes/intro_to_geobr.html)\n\n## Python, reading the data as a `geopandas` object\n```python\nfrom geobr import read_municipality\n\n# Read specific municipality at a given year\nmun = read_municipality(code_muni=1200179, year=2017)\n\n# Read all municipalities of given state at a given year\nmun = read_municipality(code_muni=33, year=2010) # or\nmun = read_municipality(code_muni=\"RJ\", year=2010)\n\n# Read all municipalities in the country at a given year\nmun = read_municipality(code_muni=\"all\", year=2018)\n```\nMore examples [here](https://github.com/ipeaGIT/geobr/tree/master/python-package/examples) \n\n# Available datasets:\n\n:point_right:  **All datasets use geodetic reference system \"SIRGAS2000\", CRS(4674).** \n\n|Function|Geographies available|Years available|Source|\n|-----|-----|-----|-----|\n|`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 |\n|`read_region`| Region | 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 | IBGE |\n|`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 |\n|`read_meso_region`| Meso region | 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 |  IBGE |\n|`read_micro_region`| Micro region | 2000, 2001, 2010, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 | IBGE |\n|`read_intermediate_region`| Intermediate region | 2017, 2019, 2020 |  IBGE |\n|`read_immediate_region`| Immediate region | 2017, 2019, 2020 |  IBGE |\n|`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 | IBGE |\n|`read_municipal_seat`| Municipality seats (sedes municipais) |  1872, 1900, 1911, 1920, 1933, 1940, 1950, 1960, 1970, 1980, 1991, 2010 | IBGE |\n|`read_weighting_area`| Census weighting area (área de ponderação) |  2010 | IBGE |\n|`read_census_tract`| Census tract (setor censitário) |  2000, 2010, 2017, 2019, 2020 | IBGE |\n|`read_statistical_grid` | Statistical Grid of 200 x 200 meters | 2010 | IBGE |\n|`read_metro_area` | Metropolitan areas | 1970, 2001, 2002, 2003, 2005, 2010, 2013, 2014, 2015, 2016, 2017, 2018 | IBGE | \n|`read_urban_area` | Urban footprints | 2005, 2015 | IBGE | \n|`read_amazon` | Brazil's Legal Amazon | 2012 | MMA | \n|`read_biomes` | Biomes | 2004, 2019 | IBGE | \n|`read_conservation_units` | Environmental Conservation Units | 201909 | MMA | \n|`read_disaster_risk_area` | Disaster risk areas | 2010 | CEMADEN and IBGE | \n|`read_indigenous_land` | Indigenous lands | 201907, 202103 | FUNAI | \n|`read_semiarid` | Semi Arid region | 2005, 2017, 2021, 2022 | IBGE | \n|`read_health_facilities` | Health facilities | 201505, 202303 | CNES, DataSUS | \n|`read_health_region` | Health regions and macro regions | 1991, 1994, 1997, 2001, 2005, 2013 | DataSUS |\n|`read_neighborhood` | Neighborhood limits |  2010 | IBGE |\n|`read_schools` | Schools |  2020, 2023 | INEP |\n|`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 |\n|`read_urban_concentrations` | Urban concentration areas (concentrações urbanas) | 2015 | IBGE | \n|`read_pop_arrangements` | Population arrangements (arranjos populacionais) | 2015 | IBGE | \n\n\n\n## Other functions:\n\n| Function | Action|\n|-----|-----|\n| `list_geobr` | List all datasets available in the geobr package |\n|`lookup_muni`| Look up municipality codes by their name, or the other way around |\n|`grid_state_correspondence_table`| Loads a correspondence table indicating what quadrants of IBGE's statistical grid intersect with each state |\n| `cep_to_state` | Determine the state of a given CEP postal code |\n| ... | ... |\n\nNote 1. Data sets and Functions marked with \"dev\" are only available in the development version of `geobr`.\n\nNote 2. Most data sets are available at scale 1:250,000 (see documentation for details).\n \n## Coming soon:\n\n| Geography | Years available | Source |\n|-----|-----|-----|\n|`read_census_tract` | 2007 | IBGE |\n| Longitudinal Database* of micro regions | various years | IBGE | \n| Longitudinal Database* of Census tracts | various years | IBGE | \n| ... | ... | ... | \n\n'*' Longitudinal Database refers to áreas mínimas comparáveis (AMCs)\n\n* [Quadro geográfico de referência para produção, análise e disseminação de estatísticas](https://www.ibge.gov.br/geociencias/organizacao-do-territorio/analises-do-territorio/24233-quadro-geografico-de-referencia-para-producao-analise-e-disseminacao-de-estatisticas.html?=\u0026t=o-que-e)\n* Outros arquivos e recortes estão disponiveis em [ftp://geoftp.ibge.gov.br/](ftp://geoftp.ibge.gov.br/).\n\n\n# Contributing to geobr\nIf you would like to contribute to geobr and add new functions or data sets, please check this [guide](https://github.com/ipeaGIT/geobr/blob/master/CONTRIBUTING.md) to propose your contribution.\n\n\n-----\n\n#### **Related projects**\n\nAs of today, there is another R package with similar functionalities: [simplefeaturesbr](https://github.com/RobertMyles/simplefeaturesbr). The **geobr** package has a few advantages when compared to *simplefeaturesbr*, including for example:\n- A same syntax structure across all functions, making the package very easy and intuitive to use\n- 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\n- Access to shapefiles with updated geometries for various years\n- Harmonized attributes and geographic projections across geographies and years\n- Option to download geometries with simplified borders for fast rendering\n- Stable version published on CRAN for R users, and on PyPI for Python users\n\n#### **Similar packages for other countries/continents**\n- Africa: [afrimapr](https://afrimapr.github.io/afrimapr.website/)\n- Argentina: [geoAr](https://github.com/PoliticaArgentina/geoAr)\n- Brazil: [geobr](https://ipeagit.github.io/geobr/)\n- Canada: [cancensus](https://mountainmath.github.io/cancensus/index.html)\n- Chile: [chilemapas](https://pacha.dev/chilemapas/)\n- Czech Republic: [RCzechia](https://github.com/jlacko/RCzechia)\n- Finland: [geofi](https://ropengov.github.io/geofi/)\n- Kazakhstan: [geokz](https://github.com/arodionoff/geokz)\n- Peru: [mapsPERU](https://github.com/musajajorge/mapsPERU) and [geoidep](https://geografo.pe/geoidep/index.html)\n- Spain: [mapSpain](https://github.com/rOpenSpain/mapSpain/)\n- UK: [geographr](https://github.com/britishredcrosssociety/geographr)\n- Uruguay: [geouy](https://github.com/RichDeto/geouy)\n- USA: [tigris](https://github.com/walkerke/tigris)\n- Global (political administrative boundaries): [rgeoboundaries](https://github.com/wmgeolab/rgeoboundaries)\n\n-----\n\n# Credits \u003cimg align=\"right\" src=\"https://github.com/ipeaGIT/geobr/blob/master/r-package/man/figures/ipea_logo.png?raw=true\" alt=\"ipea\" width=\"300\"\u003e\n\nOriginal 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:\n\n* 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.\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipeagit%2Fgeobr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipeagit%2Fgeobr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipeagit%2Fgeobr/lists"}