Skip to content
DuckDB community extension

laterite_ags4

Read AGS4 geotechnical data files as typed, UUID-keyed tables directly from SQL — born-typed columns, deterministic content-addressed keys that join across groups by construction, and an embedded AGS dictionary. A read-only SQL surface. Local, http(s):// and s3:// (with httpfs).

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 · SQL
INSTALL laterite_ags4 FROM community;
LOAD laterite_ags4 FROM community;

Try it in a temporary SQL session with laterite_ags4 already loaded. Queries run in this tab; examples using files or services need their own setup.

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

Read a group as a typed table (columns typed from the file's own TYPE row):

SQL
-- Read a group as a typed table (columns typed from the file's own TYPE row):
SELECT loca_id, loca_gl
FROM read_ags('site.ags', 'LOCA')
WHERE loca_gl > 50.0;

-- Join across groups on the deterministic keys — no shared state, joins by
-- construction (every SAMP row's _parent_id equals its LOCA's _id):
SELECT l.loca_id, s.samp_ref, s.samp_top
FROM read_ags('site.ags', 'SAMP') s
JOIN read_ags('site.ags', 'LOCA') l ON s._parent_id = l._id;

-- Inspect structure + the embedded AGS dictionary:
SELECT "group", n_rows, parent FROM ags_groups('site.ags') ORDER BY n_rows DESC;
SELECT child, parent, shared_keys FROM ags_relationships() WHERE parent = 'LOCA';

-- Remote, lazily (with httpfs):
-- LOAD httpfs;
-- SELECT loca_id FROM read_ags('s3://bucket/site.ags', 'LOCA');

Provided by niko86. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

laterite_ags4 reads AGS4 geotechnical & geoenvironmental data files as first-class DuckDB tables — no conversion step, no bundled engine.

Written in 🦀 Rust on DuckDB's C Extension API (zero C++). Part of the laterite toolkit and, like the rest of it, in beta — see what beta means.

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
niko86/laterite-duckdb
License
MIT
Maintainers
niko86
Written in
Rust
Build source
56e6634a22e6
Build definition
Community descriptor