historical_geocoding
historical_geocoding · SQL toolkit for geocoding historical addresses by combining textual, temporal, and spatial evidence.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100550 | historical_geocoding | historical_geocoding | 1.0 | GIS | MIT | SQL |
| Relationships | |
|---|---|
| Requires | geohistorical_objects postal unaccent |
Usage
Sources:
- Upstream workflow documentation at the reviewed commit
- Declared and operational dependency script
- Geocoding API source
- Extension control file
historical_geocoding is a research-oriented SQL schema for matching an address and fuzzy date against incomplete historical address data. It ranks candidate places using semantic, temporal, number, scale, spatial-distance, and source-precision terms; it does not install a ready-to-query gazetteer.
Installation and Workflow
The control file declares geohistorical_objects, postal, and unaccent. Upstream’s dependency script also installs postgis, pgsfti, and pg_trgm, which the generated SQL uses but does not declare in requires. Prepare and validate all six before creating the extension.
The main API family includes geocode_name_base, geocode_name_optimised_inter, and geocode_name_optimised. A real workflow must normalize address/date input, import and validate road and building-number sources, populate precise and rough localization tables, retain source lineage, and evaluate ranked candidates against manually verified examples.
Security and Installation Hazards
ordering_priority_function is interpolated directly into dynamic SQL after a deny-list function removes selected characters and keywords. That is not a safe SQL-injection boundary. Never pass user-controlled text; expose fixed, reviewed scoring expressions through a wrapper and revoke direct API execution from untrusted roles.
The PGXS build concatenates source files that contain unguarded sample SELECT statements and test CREATE TABLE statements into the extension install SQL. Inspect the generated historical_geocoding--1.0.sql and perform the first install only in a disposable database; do not assume creation is side-effect-free.
The reviewed project focuses on French and Paris historical data and includes partially manual research workflows. Results are probabilistic: evaluate bias, missing data, aliases, temporal uncertainty, SRID 2154 assumptions, libpostal behavior, reproducibility, and human correction with a gold-standard sample. Preserve provenance and confidence rather than overwriting source facts.