Using Geocodes

The geographic data related to Brazil’s political and administrative divisions, produced by the Brazilian Institute of Geography and Statistics (IBGE), are organized and identified through geocodes. These are numeric identifiers that uniquely represent geographic entities such as:

  • States (Federative Units)
  • Mesoregions
  • Microregions
  • Municipalities
  • Districts
  • Subdistricts
  • Census Tracts

Because these codes are unique and non-repeating, they can be used to link additional information to geographic databases or DBF files through join and relate operations in GIS software. In spreadsheet applications such as Microsoft Excel, geocodes can be used with lookup functions such as VLOOKUP (or XLOOKUP in newer versions).

Figure 1 – Examples of IBGE Geocodes

For this reason, any organization of geographic data in Excel or other spreadsheet applications should include the corresponding geocodes whenever possible.

Using geocodes offers several advantages:

  • Ensures accurate linkage between geographic and statistical data.
  • Eliminates ambiguity caused by duplicate or similar place names.
  • Simplifies data integration from multiple sources.
  • Facilitates updates and maintenance of geographic databases.
  • Improves the reliability of thematic maps and spatial analyses.

Since not all geographic entities have officially assigned unique identification codes, users may need to create their own coding systems for internal use. In such cases, it is important to establish a standardized and documented coding structure to ensure consistency across projects and databases.

Applications of Geocodes

Geocodes are commonly used for:

  • Linking demographic and socioeconomic data to maps.
  • Integrating census information into GIS projects.
  • Creating thematic maps.
  • Market analysis and territory management.
  • Public administration and urban planning.
  • Statistical reporting and spatial analysis.

Best Practices

  • Always store geocodes as text fields when leading zeros must be preserved.
  • Include geocodes in all spreadsheets intended for GIS integration.
  • Avoid using municipality names as the primary key for data joins.
  • Maintain metadata documenting the origin and structure of the geocodes used.

Validate geocodes before performing joins or database integrations.

Additional information can be found in the Municipality Geocode dataset available from:  https://www.gismaps.com.br/downloads/municipality-geocode/.