H3 indexes every GPS ping into a hexagonal cell, builds a trajectory, scores environmental risk per cell, and catches GPS spoofing before a false claim reaches a human moderator.
Every GPS coordinate maps to an H3 cell. Cells at finer resolutions nest inside coarser parents — enabling risk rollup from block-level to city-level.
| Resolution | Avg area | Avg edge length | Use in this system |
|---|---|---|---|
| 6 | 36.1 km² | 3.2 km | City-zone aggregation |
| 7 | 5.2 km² | 1.2 km | Neighbourhood risk indexing |
| 8 | 0.74 km² | 0.46 km | Micro-zone premium scoring |
| 9 | 0.10 km² | 0.17 km | Trajectory tracking (primary) |
| 10 | 0.015 km² | 0.066 km | Block-level anti-spoof |
Three independent checks run on every ping. Each failed check contributes a weight to a rolling spoof score. The score determines auto-approval, review, or rejection.
Compute haversine distance between prev and curr cell centers. Flag if implied speed >80 km/h.
grid_distance(prev, curr) at res 9. Each hop ≈174m. Flag if hops >12 in a 2-min window.
grid_disk(claimed_cell, 1) must intersect trajectory window. 1-ring buffer allows for GPS drift.
From raw GPS ping to claim decision — every step mapped.
Worker app captures lat/lng every 2 minutes via device GPS. Timestamp and accuracy radius are recorded alongside coordinates.
Coordinate is converted to an H3 cell at resolution 9 (~100m²). The cell ID is a compact 64-bit integer used for all downstream lookups.
Cell is appended to a sliding window of the last 30 pings (60 minutes). Older pings are evicted. Trajectory is persisted to Redis keyed by worker ID.
Three checks run synchronously: speed (haversine km/h), hop continuity (grid_distance), and — on claim events — claim location overlap (grid_disk intersection).
Cells in the trajectory are looked up in the risk index (Redis hash). Environmental and social risk scores are fetched for premium calculation and claim evaluation.
Spoof score routes the claim to auto-approve (instant payout via Razorpay), human review queue, or auto-reject with deposit hold and account flag.