address_standardizer

address_standardizer

postgis : Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
1505
address_standardizer
postgis
3.6.2
GIS
GPL-2.0
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-r
No
Yes
No
Yes
yes
no
Relationships
See Also
pgrouting
pointcloud
pointcloud_postgis
h3
h3_postgis
q3c
ogr_fdw
geoip
Siblings
postgis
postgis_topology
postgis_raster
postgis_sfcgal
postgis_tiger_geocoder
address_standardizer_data_us

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PGDG
3.6.2
18
17
16
15
14
postgis-
RPM
PGDG
3.6.2
18
17
16
15
14
postgis36_$v-
DEB
PGDG
3.6.2
18
17
16
15
14
postgresql-$v-postgis-3-
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PGDG 3.6.1
PGDG 3.6.1
PGDG 3.6.1
PGDG 3.6.1
PGDG 3.6.1
el8.aarch64
PGDG 3.6.1
PGDG 3.6.1
PGDG 3.6.1
PGDG 3.6.1
PGDG 3.6.1
el9.x86_64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
el9.aarch64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
el10.x86_64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
el10.aarch64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
d12.x86_64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
d12.aarch64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
d13.x86_64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
d13.aarch64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
u22.x86_64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
u22.aarch64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
u24.x86_64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
u24.aarch64
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2
PGDG 3.6.2

Source

Install

Make sure PGDG repo available:

pig repo add pgdg -u    # add pgdg repo and update cache

Install this extension with pig:

pig install postgis;		# install via package name, for the active PG version
pig install address_standardizer;		# install by extension name, for the current active PG version

pig install address_standardizer -v 18;   # install for PG 18
pig install address_standardizer -v 17;   # install for PG 17
pig install address_standardizer -v 16;   # install for PG 16
pig install address_standardizer -v 15;   # install for PG 15
pig install address_standardizer -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION address_standardizer;

Usage

Address Standardizer: Address parsing and standardization for PostGIS

The Address Standardizer is a PostGIS extension that parses a single-line address string into a structured form using configurable lexicon, grammar, and rules tables. It is a more flexible alternative to the built-in normalize_address function in the TIGER geocoder.

Setup

CREATE EXTENSION address_standardizer;

Standardizing Addresses

The core function takes an address string and three table references (lex, gaz, rules):

SELECT *
FROM standardize_address(
    'us_lex',        -- lexicon table
    'us_gaz',        -- gazetteer table
    'us_rules',      -- rules table
    '1600 Pennsylvania Ave NW, Washington, DC 20500'
);

The result contains structured fields:

FieldDescription
buildingBuilding name or identifier
house_numStreet number
predirPrefix direction (N, S, E, W)
qualQualifier
pretypePrefix type
nameStreet name
suftypeSuffix type (St, Ave, Blvd)
sufdirSuffix direction
ruralrouteRural route
extraExtra information
cityCity name
stateState
countryCountry
postcodeZIP/postal code
boxPO Box
unitUnit/apartment number

Lexicon, Gazetteer, and Rules Tables

The standardizer is driven by three user-configurable tables:

Lexicon (lex) – Maps input tokens to standardized forms and token classes:

CREATE TABLE us_lex (
    id serial PRIMARY KEY,
    seq integer,
    word text,
    stdword text,
    token integer
);

Gazetteer (gaz) – Maps place names (cities, states) to standard forms:

CREATE TABLE us_gaz (
    id serial PRIMARY KEY,
    seq integer,
    word text,
    stdword text,
    token integer
);

Rules (rules) – Defines grammar rules for parsing addresses:

CREATE TABLE us_rules (
    id serial PRIMARY KEY,
    rule text
);

For US addresses, the address_standardizer_data_us extension provides pre-built data for these tables.

Last updated on