Skip to content
EN
← All projects

Geocod

Turns a handwritten address into a point on the map, using the city's official register and the IBGE address grid. All inside PostgreSQL.

PostGISPL/pgSQL
Handwritten address becoming a geographic point on a map

What it is

Geocod is the engine that finds on the map an address someone typed however they could. It runs entirely inside PostgreSQL/PostGIS, in PL/pgSQL functions, with no application layer in between. Together with the Geocod API and Geocod Web, it forms a set of three pieces.

What it is for

Put health records on the map using the official street register and the IBGE address grid, without personal data ever leaving the database.

What it does

  • Compares the text through a 12-phase cascade: trigrams, Jaro-Winkler, phonetics and handling of connectors.
  • Resolves the street and, when possible, the door number (exact or interpolated).
  • Records how each address was resolved, for audit and correction.
  • Works by neighborhood and, if it needs to relax the scope, flags it in the result.
  • Flags ambiguities instead of guessing, and points out duplicate streets in the register.
  • In tests with 10,000 real addresses from health records, it resolved 88% of streets and 69% of door numbers, at about 224 addresses per second (development machine).
  • Pairs with the Geocod API, which offers it to other systems, and with Geocod Web, which puts it in the hands of people who do not code.
Geocod flow: address, standardization, 12-phase cascade and result
From address to point, all inside the database.
Geocod Web, Geocod API and Geocod forming a single flow, from address to point on the map
The three pieces working together.

Part of a set

Technologies

  • PostgreSQL
  • PostGIS
  • PL/pgSQL
  • pg_trgm
  • fuzzystrmatch
  • unaccent

Security

  • Personal data never leaves the database.
  • Read-only on the register; source data is not changed.
  • Every result carries traceability of how it was obtained.
  • Known limitations are documented, not hidden.