// geospatial intelligence layer

Hexagonal grid
risk & fraud detection

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.

16
Resolution levels
2 min
GPS sample interval
3
Anti-spoof checks
Res 9
Tracking resolution
How the grid works

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.

live grid — click cells to inspect
ResolutionAvg areaAvg edge lengthUse in this system
636.1 km²3.2 kmCity-zone aggregation
75.2 km²1.2 kmNeighbourhood risk indexing
80.74 km²0.46 kmMicro-zone premium scoring
90.10 km²0.17 kmTrajectory tracking (primary)
100.015 km²0.066 kmBlock-level anti-spoof
GPS trajectory validation

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.

GPS ping every 2 min H3 index latlng_to_cell(9) Trajectory last 30 pings Validator speed · hops · overlap spoof score [0→1] score? <0.60 Approve auto payout 0.6–0.85 Review human queue >0.85 Reject deposit hold + flag risk cell data (AQI, rain, closures)

Check 1 — Speed

Compute haversine distance between prev and curr cell centers. Flag if implied speed >80 km/h.

+0.50 to spoof score

Check 2 — Hop count

grid_distance(prev, curr) at res 9. Each hop ≈174m. Flag if hops >12 in a 2-min window.

+0.40 to spoof score

Check 3 — Claim overlap

grid_disk(claimed_cell, 1) must intersect trajectory window. 1-ring buffer allows for GPS drift.

+0.40 to spoof score
0.00–0.59
Auto-approve
Payout triggered instantly
0.60–0.84
Human review
Queued for moderator
0.85–1.00
Auto-reject
Deposit held + account flagged
Step-by-step execution

From raw GPS ping to claim decision — every step mapped.

01

GPS sample

Worker app captures lat/lng every 2 minutes via device GPS. Timestamp and accuracy radius are recorded alongside coordinates.

gps_ping = { lat, lng, ts, accuracy_m }
02

H3 indexing

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 = h3.latlng_to_cell(lat, lng, res=9)
03

Trajectory append

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.

trajectory.append(cell) ; trajectory = trajectory[-30:]
04

Anti-spoof validation

Three checks run synchronously: speed (haversine km/h), hop continuity (grid_distance), and — on claim events — claim location overlap (grid_disk intersection).

score = speed_check() + hop_check() + claim_check()
05

Risk cell lookup

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.

risk = risk_map.get(cell, 0.0)
06

Decision & payout

Spoof score routes the claim to auto-approve (instant payout via Razorpay), human review queue, or auto-reject with deposit hold and account flag.

if score < 0.60: payout() elif score < 0.85: queue_review() else: reject()