Skip to content
LocusQ

Map any PostGIS data into the LocusQ schema

DataLab compiles a YAML mapping into INSERT … SELECT and lets Postgres do the work. Use the CLI, or run whole builds (convert, pg2osm, DataGen) from its server and web app.

Data

0.5.0Free

01What it does

A mapping file, compiled to SQL

Each rule names a source table, a target family, lookups for kind and class, and templates for ids and parents. An unknown key is an error, with a hint for a near miss. --dry-run prints the SQL and writes nothing.

bash
npx tsx bin/locusq-convert.ts mappings/<your-mapping>.yaml --dry-run          # print the SQL, write nothing
npx tsx bin/locusq-convert.ts mappings/<your-mapping>.yaml                    # convert
npx tsx bin/locusq-convert.ts mappings/<your-mapping>.yaml --report counts.json

No row dropped for a vocabulary gap

A value the vocabulary does not know becomes the kind other, and the original value is kept in the row's tags as source:<column>. Every run reports, per rule, source rows = inserted + excluded.

Whole builds from the web app

The server keeps projects, mapping versions and builds, and runs apply-schema, convert, pg2osm and DataGen as stages with a live log. Every /api route needs a bearer token of at least 32 characters.

bash
DATALAB_API_TOKEN=$(openssl rand -hex 32) LOCUSQ_VOCABULARY=… DATALAB_DATA_DIR=/tmp/dl \
  npx tsx server/src/server.ts

02Install

Run DataLab 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. Install

    Node 24. The CLI runs from source with npx tsx; there is no build step for it.

    bash
    npm ci                                    # installs the workspaces, including tsx
    export LOCUSQ_VOCABULARY=/path/to/locusq-schema/vocabulary.yaml
  3. Convert your data

    The password must be in the DSN. Set LOCUSQ_TARGET_DSN to write the schema into another database than the source.

    bash
    export LOCUSQ_SOURCE_DSN="postgresql://user:pass@127.0.0.1:5432/yourdb?sslmode=disable"
    npx tsx bin/locusq-convert.ts mappings/<your-mapping>.yaml

Bring your own data in

The guide covers mapping files, split source and target, and builds.