Skip to content
LocusQ

Schema

What it is

The canonical PostGIS schema (v2, namespace locusq) that DataLab writes and pg2osm and DataGen read: any country, any admin depth, any language.

apply.sh applies each migration once and records it in public.locusq_schema_migrations, so it is safe to re-run. A checksum mismatch stops it with exit code 3.

vocabulary.yaml is the tag contract that pg2osm turns into OSM tags. Adding terms is a minor version and needs no DDL change. Vocabulary 2.3.0 adds the kind other, the fallback for unmapped values.

Released migrations are never edited; a new one is added. A breaking DDL change means a major version. tests/run.sh runs the full v2 suite against its own PostGIS container.

Install

The repositories and packages are private while LocusQ is in private release. Ask for access and say which tools you need.

Apply the schema to your database

Use 127.0.0.1 and ?sslmode=disable: psql 18 cannot negotiate with a PostGIS 17 server otherwise, and localhost resolves to ::1 and fails.

bash
DSN="postgresql://user:pass@127.0.0.1:5432/yourdb?sslmode=disable"
scripts/apply.sh "$DSN"
scripts/verify_v2.sh "$DSN"

Minimal usage

Apply v2 to an empty PostGIS database and verify it; verify_v2.sh exits 0 and prints a PASS line:

bash
scripts/apply.sh "$DSN" v2
scripts/verify_v2.sh "$DSN"

Product page: Schema. Release notes: Changelog.