Skip to content
LocusQ

Geocoder data from your own places

DataGen reads locusq.place and writes Who's On First GeoJSON, GeoNames TSV and a Pelias Placeholder store for the geocoder. Choose rows with --source; nothing is country-specific.

Data

0.2.1Free

01What it does

Three formats in one run

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.

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

Stable ids, safe re-runs

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.

text
wof:id            [1e15, 9e15)
geonameid         [1e10, 9e14)
alternateNameId   [1e10, 9e14)

A validator for each format

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.

bash
locusq-datagen validate    --input ./output/wof --format wof

02Install

Run DataGen yourself

  1. Get access

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

  2. Build the image

    bash
    docker build -t locusq-datagen .
  3. 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

Feed the geocoder your places

The guide covers the outputs, id ranges and validation.