Traditional analytics pipelines require a server-side database, a network request, and a response round-trip. DuckDB WASM compiles the entire analytical engine to WebAssembly and ships it with the GeoFMV client. Query millions of detection records, join them with remote GeoParquet contextual data, and render map features โ all without leaving the browser tab.
// Initialize DuckDB WASM + extensions
import * as duckdb from '@duckdb/duckdb-wasm';
const db = await duckdb.createInMemory();
const conn = await db.connect();
// Load spatial extension
await conn.query(`INSTALL spatial; LOAD spatial;`);
// Load cloud access extension
await conn.query(`INSTALL httpfs; LOAD httpfs;`);
// Query GeoFMV detection results
const result = await conn.query(`
SELECT class_label, COUNT(*) as count,
ST_Collect(geometry) as geom
FROM detections.parquet
WHERE confidence > 0.7
GROUP BY class_label
`);
Each extension is optional and loaded on demand. GeoFMV's settings dialog shows which are active and provides per-extension configuration.
spatial extensionST_Read() โ load any GDAL-supported format directly in SQLST_Within, ST_Intersects, ST_Distance-- Load detections from a GeoPackage
SELECT * FROM ST_Read('detections.gpkg');
-- Spatial join: detections within a building polygon
SELECT d.class_label, d.confidence,
b.building_name
FROM detections d, ST_Read('buildings.geojson') b
WHERE ST_Within(d.geometry, b.geom);
-- Query remote GeoParquet with spatial filter
SELECT * FROM read_parquet(
's3://my-bucket/contextual/roads.parquet'
)
WHERE ST_DWithin(geometry, ST_Point(-77.03, 38.89), 500);
httpfs extensions3://) โ IAM or access key authaz:// / abfs://)gcs://)-- Configure S3 credentials
SET s3_region='us-east-1';
SET s3_access_key_id='AKI...';
SET s3_secret_access_key='...';
-- Query partitioned detection archive directly
SELECT date_trunc('day', timestamp_us) as day,
class_label,
COUNT(*) as detections
FROM read_parquet('s3://geofmv-archive/detections/**/*.parquet')
WHERE confidence > 0.8
GROUP BY 1, 2
ORDER BY day;
-- Azure: scan contextual overlay from Blob
SELECT * FROM ST_Read(
'az://geofmv-container/overlays/aoi.geojson'
);
zipfs extension.zip as a virtual read-only filesystem.3tz (3D Tiles archive) tile index + metadata without extractionhttpfs (combine with S3/HTTP access)-- Mount a local ZIP as a virtual filesystem
CALL mount_zip('fmv_export_bundle.zip', '/export');
-- Query Parquet files inside the ZIP
SELECT * FROM read_parquet('/export/detections/*.parquet');
-- Access 3D Tiles archive metadata
CALL mount_zip('terrain.3tz', '/tiles');
SELECT * FROM read_json('/tiles/tileset.json');
-- Remote ZIP via httpfs + zipfs combination
CALL mount_zip(
's3://geofmv-archive/bundles/mission_42.zip',
'/mission'
);
SELECT * FROM ST_Read('/mission/aoi.geojson');
sqlite_scanner extension.gpkg GeoPackage files exported from QGIS or ArcGIS Pro-- Attach a GeoPackage as a DuckDB database
ATTACH 'mission_detections.gpkg' AS gpkg (TYPE sqlite);
-- List tables in the GeoPackage
SHOW ALL TABLES;
-- Query accepted detections
SELECT class_label, confidence, geom
FROM gpkg.detections
WHERE review_status = 'ACCEPTED'
AND confidence > 0.6;
postgres_scanner extension-- Attach enterprise PostGIS geodatabase
ATTACH 'postgresql://gis_user:pass@db.org/geodb'
AS ent_gdb (TYPE postgres);
-- Spatial join: detections + PostGIS parcels layer
SELECT d.class_label, p.parcel_id, p.owner
FROM detections d
JOIN ent_gdb.parcels p
ON ST_Within(d.geometry, p.geom)
WHERE d.review_status = 'ACCEPTED';
azure extension-- Configure Azure access
SET azure_storage_connection_string='DefaultEndpointsProtocol=https;...';
-- Read detection archive from Azure Blob
SELECT mission_id, COUNT(*) as detections
FROM read_parquet(
'az://geofmv/detections/2026/**/*.parquet'
)
GROUP BY mission_id
ORDER BY detections DESC;
iceberg extension-- Query current Iceberg detection table
SELECT * FROM iceberg_scan(
's3://geofmv-lake/detections/'
)
WHERE class_label = 'vehicle'
AND confidence > 0.85;
-- Time-travel: detections as of last week
SELECT * FROM iceberg_scan(
's3://geofmv-lake/detections/',
version => '2026-03-11T00:00:00'
);
| Data Source | Extension | Protocol | Auth | Spatial | Streaming |
|---|---|---|---|---|---|
| GeoPackage (.gpkg) | spatial or sqlite_scanner | Local file | โ | โ | โ |
| GeoJSON / GeoParquet | spatial | File / HTTP | โ | โ | โ |
| Shapefile (.shp) | spatial | Local file | โ | โ | โ |
| FlatGeoBuf (.fgb) | spatial | HTTP/HTTPS | โ | โ | โ |
| AWS S3 Parquet | httpfs | s3:// | IAM / Key | โ w/ spatial | โ |
| Azure Blob Storage | azure | az:// | Connection str / MI | โ w/ spatial | โ |
| Google Cloud Storage | httpfs | gcs:// | Service account | โ w/ spatial | โ |
| HTTP/HTTPS remote file | httpfs | https:// | โ | โ w/ spatial | โ |
| ZIP archive (local/remote) | zipfs | File / s3:// | Via httpfs | โ w/ spatial | โ |
| 3D Tiles archive (.3tz) | zipfs | File / s3:// | Via httpfs | Metadata only | โ |
| SQLite / GeoPackage DB | sqlite_scanner | Local file | โ | โ | โ |
| PostgreSQL / PostGIS | postgres_scanner | postgresql:// | User/Pass | โ | โ |
| Supabase PostGIS | postgres_scanner | postgresql:// | User/Pass | โ | โ |
| Apache Iceberg (S3/ADLS) | iceberg | s3:// / az:// | Via httpfs/azure | โ w/ spatial | โ |
| CSV / TSV (DJI telemetry) | Built-in | Local file | โ | โ | โ |
| JSON / NDJSON | Built-in | Local / HTTP | โ | โ | โ |
| Parquet | Built-in | Local / s3:// | Via httpfs | โ w/ spatial | โ |