Enforce the road,
not the moment.

A spot camera measures one instant and tells you nothing about the kilometre either side of it. Smart Checkpoints models a city as a graph of camera checkpoints, resolves the real driving distance between them, and computes average speed across the whole stretch.

Cairo · project 1driver connected
CP-04CP-07CP-04 → CP-070 m0smeasuring edge…
The problem

Speed is a property of a road, not of a point on it

Every driver already knows how to defeat a fixed camera. The fix is not a better camera. It is measuring something a single camera cannot see.

Point enforcement

Honest about one instant

A spot camera samples speed at a single position. Drivers learn where it is, brake for it, and accelerate past it. The reading is accurate, the paperwork is clean, and the road stays unprotected.

Average speed over distance

Accountable for the whole stretch

Two checkpoints bound a length of road, and what matters is the time taken between them. There is no single point to slow down for, and a fast stretch cannot be averaged away by braking at the camera.

How it works

Four steps from a camera to a verdict

Nothing in the chain is clever. Each step does one thing, and the number that matters, the road distance, is the one the system refuses to guess.

The same vehicle is seen twice

Every checkpoint is a camera that records a plate and the moment it passed. Enforcement begins when one plate appears at two checkpoints that share an edge, not when it passes any single camera.

The road distance is resolved

The server knows the two checkpoints are connected. It does not know how far apart they are by road, so it asks a distance driver, which routes between them and answers in metres.

Average speed is computed

Distance divided by elapsed time gives the average speed across the whole edge. Held against the edge's speed limit, the run either fits inside the time the limit allows or it does not.

The run is recorded

Every traversal is stored against its edge with its elapsed time, which also feeds the live congestion figure. Violations are simply the runs that crossed the edge faster than the limit permits.
Architecture

A graph that refuses to guess its own distances

Two ideas carry the system. A road network is stored as a graph, and that graph does not know how far apart its own checkpoints are, so it asks.

The graph model

Enforcement is a property of an edge, not of a camera. An edge carries two numbers, and those two numbers are all the logic needs: distance in metres, divided by the limit in km/h, times 3.6, is the number of seconds the edge cannot legally be crossed in less than.

Adding a checkpoint means adding a node and declaring which existing nodes it connects to. Everything downstream follows from the shape of the graph.

Node
A camera checkpoint. Carries a coordinate and an index within its project.
Edge
A stretch of road between two checkpoints that is actually enforced. Carries a speed limit and a distance.
Project
One deployment: a set of checkpoints and the edges between them, behind its own operator key.
1,767 mnodes, edges, one resolved route

Pluggable distance drivers

Road distance depends on a map, and a map is a dependency worth keeping outside the server. So a driver is a separate process: it opens a WebSocket, authenticates with a project operator key, and waits. The server sends the two checkpoint coordinates and a request id; the driver answers with a number of metres against the same id, and optionally the shape of the road it found.

That is the whole contract: coordinates in, metres out, geometry optional. It says nothing about how the distance is obtained, which is exactly what makes drivers interchangeable.

serverholds the checkpoint graphdefaultdistances supplied with the graphdriver-osrmroutes each edge with OSRMsimulationfixture distances, no map neededcoordinates in, metres out

The wire format

An OSRM server, a commercial routing API, a table of surveyed distances, or figures measured by hand for a network no public map covers well. All of them answer the same exchange.

server -> driver
{ "type": "calculate-distance",
  "requestId": "6f659d37",
  "from": { "latitude": 30.044, "longitude": 31.236 },
  "to":   { "latitude": 30.046, "longitude": 31.224 } }

driver -> server
{ "type": "distance-result",
  "requestId": "6f659d37",
  "distance": 1767.5,
  "path": { "type": "LineString", "coordinates": [...] } }

What happens when it fails

A driver that cannot route an edge says so, with a reason: no road here, or the map service is down. Genuine silence hits a timeout. Either way the server never fills the gap with a straight-line guess, and the edge is left unresolved.

That is deliberate. An unresolved edge is a visible gap that enforces nothing. A plausible wrong distance is an invisible one, and it produces violations that look exactly like real ones.

edge 4 → 7 · unresolved · driver said no-route
Open source

Every part of it is readable

Four repositories, no hidden service in the middle. The protocol between them is small enough to reimplement in an afternoon.

Documentation

Read how it actually works

The site is the argument. The documentation is the system: the protocol, the data model, and the deployment guides, all in one place.

Downloads

Builds, when there is something worth versioning

Packaged releases will be published here. Until then every component runs from source, and the source is the whole product.

No releases published yet
  • server

    Linux x64 · Docker image

    pending
  • driver-osrm

    Linux x64 · Docker image

    pending
  • simulation

    Linux x64 · macOS · Windows

    pending

Clone any repository and run it directly.

github.com/smart-checkpoints

Enforce the road, not the moment

Every component runs from source, the protocol between them is small enough to reimplement in an afternoon, and all of it is MIT licensed.