Skip to content
LocusQ

DataGen

What it is

Generates Who's On First GeoJSON, GeoNames TSV and a Pelias Placeholder store from the locusq.place table, for the geocoder to import.

generate --all writes the WOF tree and its SQLite bundle, one GeoNames file per country and the Placeholder store. --validate checks each output after it is written.

Ids are minted from country code, source and source id, in ranges clear of real WOF and GeoNames ids. A re-run gives the same ids and swaps each output in atomically.

validate checks WOF ids, geometry and hierarchy, GeoNames columns and id ranges, and the five Placeholder tables. It exits 1 on any error, and on warnings too with --strict.

Install

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

Build the image

bash
docker build -t locusq-datagen .

Generate

The container runs as uid 10001, so the output directory must be writable by it. Pass the database URL through LOCUSQ_DB_URL, not on the command line.

bash
export LOCUSQ_DB_URL="postgresql://user:pass@localhost:5432/dbname"
docker run --rm --network host -e LOCUSQ_DB_URL \
  -v "$PWD/output:/work/output" \
  locusq-datagen generate --source <source> --output /work/output --all

Minimal usage

Generate everything for one source, then validate the WOF tree on its own:

bash
locusq-datagen generate --source <source> --output ./output --all --validate
locusq-datagen validate --input ./output/wof --format wof

Licence

MIT.

Product page: DataGen. Release notes: Changelog.