Skip to content

Bash script to produce GeoJSON data from IBGE Brazil geographic data

License

Notifications You must be signed in to change notification settings

evanchodora/br-geojson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Brazil GeoJSON Data

Creates GeoJSON map data for Brazilian states and the entire country using the data published by the IBGE (Instituto Brasileiro de Geografia e Estatistica). This code currently uses the most recent data published May 20, 2020 and represents the 2019 dataset. You can read more about the dataset here.

Dependencies

The script uses ogr2ogr to convert the files from Shapefiles to GeoJSON. It is a part of the Geospatial Data Abstraction Library (GDAL). Check their site for downloads compatible with your system. It is also included in the Homebrew (Mac) and apt (Debian/Ubuntu) package managers as well.

Outputs

Running get_geojson.sh will create a data directory with 4 files for each state (and optionally the entire country):

  • UF_municipalities.json: GeoJSON file for the IBGE municipalities (municipios) within a particular Unidade Federativa (UF)
  • UF_microregions.json: GeoJSON file for the IBGE microregions (microrregiões) within a UF
  • UF_mesoregions.json: GeoJSON file for the IBGE mesoregions (mesorregiões) within a UF
  • UF_state.json: GeoJSON file for the geometry of each UF

Options

  • -c or --clean: will delete the tmp directory created to store all the original Shapefiles upon completion
  • -b or --brasil: will optionally download every municipality, mesoregion, etc. for the whole country as one file (large files)

About

Bash script to produce GeoJSON data from IBGE Brazil geographic data

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages