mirror of
https://github.com/zvx-echo6/central.git
synced 2026-08-26 09:21:36 +00:00
Central - data hub spine. Adapters -> NATS/JetStream -> archive.
- Python 88.6%
- HTML 9.4%
- CSS 1.2%
- Shell 0.6%
- PLpgSQL 0.2%
FIRMS hotspots rendered as tiny dots on /events because the adapter shipped a degenerate point-bbox (lon,lat,lon,lat) and no geometry. _build_geom_sql collapsed that into a 5-vertex zero-area Polygon. Fix: construct a real rectangular GeoJSON Polygon from (latitude, longitude, scan, track) per record and ship it via Geo.geometry, mirroring the v0.9.3 pattern used by tomtom_flow. - _pixel_polygon() builds a CCW 4-corner ring with the closing vertex duplicated. Cross-track (longitude) extent scales by cos(lat). Latitude is pole-clamped to ±89° defensively. - _row_to_event drops the degenerate bbox and sets geo.geometry; centroid stays alongside for consumers that read centroid only. - poll() counts emitted records that fell back to centroid-only Geo (missing scan/track) and emits a single per-cycle warning if > 0, not per-record. - Forward-only: same dedup keys, new payload shape for new records. Existing PostGIS rows retain their degenerate-polygon geometry until republished or aged out. - Removes a pre-existing unused RegionConfig import in tests/test_firms.py. Tests: 5 new pixel-polygon unit tests + 2 archive round-trip regression guards mirroring test_archive_prefers_geo_geometry. Existing test_event_geo updated to assert the new geometry shape. Full suite 930 passed, 1 skipped under both central and zvx users. |
||
|---|---|---|
| docs | ||
| etc-templates | ||
| scripts | ||
| sql | ||
| src/central | ||
| systemd | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .python-version | ||
| CHANGELOG.md | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
Central
Central is the data hub spine for the infrastructure. Adapters normalize upstream sources into a canonical event shape, publish CloudEvents to NATS/JetStream, and archive to TimescaleDB for historical query. Single-LXC deployment.
Status
Phase 0 — scaffold. Not yet operational.
Architecture
- Python 3.12 (uv-managed)
- NATS + JetStream for live event bus
- TimescaleDB + PostGIS for archive and geospatial query
- One supervisor process managing adapter lifecycle
- One archive consumer process persisting events to TimescaleDB
- Both processes systemd-managed
Testing
See docs/test-database.md for test database setup.
License
MIT. See LICENSE.