docs: SSH-based bulk sync and peer queries, spatial extension
Replace object-store replication with rsync over persistent multiplexed SSH (ed25519, pinned known_hosts, forced commands as the only remote API); demote GraphQL to the ground integration standard. Add DuckDB spatial extension for separation audits, perimeter predicates and trajectory analysis in the local planar frame.
This commit is contained in:
@@ -109,6 +109,33 @@ FROM read_parquet('…/sensor=imu/**/*.parquet')
|
||||
GROUP BY second ORDER BY second;
|
||||
```
|
||||
|
||||
## Spatial queries: DuckDB spatial extension
|
||||
|
||||
Positions and detections are inherently spatial, and the [DuckDB spatial extension](https://github.com/duckdb/duckdb-spatial) makes them queryable as geometry without leaving the engine (`INSTALL spatial; LOAD spatial;`). Its current lack of spherical-coordinate support is irrelevant here: the swarm operates in a **local planar mission frame in meters**, which is exactly the geometry model the extension handles best.
|
||||
|
||||
```sql
|
||||
LOAD spatial;
|
||||
|
||||
-- Minimum separation between two drones over a flight (replay safety audit)
|
||||
SELECT min(ST_Distance(ST_Point(a.pos_x, a.pos_y), ST_Point(b.pos_x, b.pos_y))) AS min_sep_m
|
||||
FROM read_parquet('…/dataset=state/flight=…/drone=dr-01/**/*.parquet') a
|
||||
JOIN read_parquet('…/dataset=state/flight=…/drone=dr-02/**/*.parquet') b
|
||||
ON a.ts_ns // 200000000 = b.ts_ns // 200000000; -- align to 200 ms buckets
|
||||
|
||||
-- Detections inside the mission perimeter polygon
|
||||
SELECT cls, count(*)
|
||||
FROM read_parquet('…/dataset=detections/flight=…/**/*.parquet')
|
||||
WHERE ST_Within(ST_Point(obj_x, obj_y), ST_GeomFromText('POLYGON((…))'))
|
||||
GROUP BY cls;
|
||||
|
||||
-- Trajectory as a geometry (export for replay overlays)
|
||||
SELECT drone, ST_MakeLine(list(ST_Point(pos_x, pos_y) ORDER BY ts_ns)) AS path
|
||||
FROM read_parquet('…/dataset=state/flight=…/**/*.parquet')
|
||||
GROUP BY drone;
|
||||
```
|
||||
|
||||
On the ground this powers replay overlays, coverage analysis (did ubiquitous sensing actually cover the area?), and separation audits; on board it is available for cheap geo-predicates (e.g. "detections within R meters of me") with no extra service.
|
||||
|
||||
## Schema management
|
||||
|
||||
- Every dataset schema is versioned in-repo (`schemas/` — SemVer, one file per dataset version) and referenced by the fleet release manifest ([11](11-cicd-delivery.md)).
|
||||
|
||||
Reference in New Issue
Block a user