Skip to content
pyautark (soon)

autk-db

npm version

autk-db is a browser-native spatial database powered by DuckDB. It lets you load, query, and transform urban data entirely on the browser.

Key capabilities:

  • Load data from OpenStreetMap (using Overpass API or previously downloaded .pbf files, e.g. from Geofabrik), CSV, JSON, GeoJSON, and GeoTIFF.
  • Run spatial operations and custom SQL queries inside the browser.
  • Export processed data for autk-map, autk-compute, autk-plot or any software.

Package installation

To install autk-db, you must install its NPM pakage.

bash
npm install @urban-toolkit/autk-db

You can also have access to the library by installing the complete Autark package.

bash
npm install @urban-toolkit/autk

Initialization

The entry point of autk-db is the AutkDb class. To use it, you must create a database instance and await init() seting up DuckDB and loading its official spatial extension.

Basic workflow

Most autk-db workflows follow a simple three-step pattern. First, you load one or more datasets into DuckDB tables. Then you use autk-db methods to inspect, filter, join, or transform those tables. Finally, you bring the result back into JavaScript as GeoJSON, so use it in autk-map, autk-plot, autk-compute or any other software:

  1. Load data into named DuckDB tables.
  2. Query, analyze, or transform those tables inside DuckDB.
  3. Retrieve the result back into JavaScript when needed.

Released under the MIT License.