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.
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.
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.
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.
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
The road distance is resolved
Average speed is computed
The run is recorded
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.
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.
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.
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.
server
The core service
Holds the checkpoint graph, records sightings, talks to distance drivers, and turns edge distance and speed limit into violations.
driver-osrm
The reference distance driver
Resolves edge distances by asking an OSRM routing server for the driving route between two checkpoints. Answers in metres, or not at all.
simulation
Traffic without cameras
Drives synthetic vehicles across a checkpoint graph so the enforcement path can be exercised end to end without a live deployment.
docs
The documentation site
Source for docs.smartcheckpoints.xyz: the protocol reference, the data model, and deployment guides.
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.
Documentation
The whole system written down: concepts, interfaces, and how the pieces fit together.
Read itQuickstart
Run the server, build a two checkpoint graph, and produce your first violation.
Read itThe graph model
Projects, checkpoints, edges, and the arithmetic that decides a violation.
Read itDistance drivers
How the server asks for a road distance, and what happens when nothing answers.
Read itREST API
Every HTTP endpoint the server exposes, with its authentication and its shape.
Read itThe console
The operator surface the server ships with: the project list, the live graph, and administration.
Read itBuilds, 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.
- pending
server
Linux x64 · Docker image
- pending
driver-osrm
Linux x64 · Docker image
- pending
simulation
Linux x64 · macOS · Windows
Clone any repository and run it directly.
github.com/smart-checkpointsEnforce 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.