Skip to content

The shared model#

SurfaceLens keeps one model per airport. Feeds write observations into it. Applications read entities out of it. This page explains both, and how one becomes the other.

Entities#

An entity is a thing on or around the airfield that has an identity and a state: an aircraft, a flight, a vehicle, a person, a stand, a runway. Every entity has an ID of the form type:key.

aircraft:8851a4
An aircraft, keyed by its ICAO 24-bit address in lower-case hex. Registration changes do not change the ID.
flight:TG403-20261123
One operation of a flight number on its scheduled date (local time at the origin).
vehicle:TUG-114
A ground vehicle, keyed by its fleet number as the operator assigns it.
person:wk_51c7
A worker with a position feed. The key is a pseudonym issued by the airport; SurfaceLens never stores names.
stand:C2
An aircraft stand, keyed by its published name.
runway:02R-20L
A physical runway, keyed by both designators. Taxiways (taxiway:B) and named areas (area:apron-c) follow the same pattern.

IDs are stable and readable, so you can write them in configuration, logs and tests. The airfield model is the authority for stands, runways, taxiways and areas; their IDs are the feature IDs in the airfield GeoJSON.

Entity types#

Each type has its own attributes. All attributes are optional: an entity carries what its feeds have reported.

Type Main attributes
aircraft registration, icao24, aircraft_type, callsign, flight, stand, movement, heading_deg, ground_speed_kt, on_ground
flight airline, number, direction, origin, destination, scheduled_at, estimated_at, actual_at, aircraft, stand, runway, status
vehicle vehicle_type, operator, movement, heading_deg, ground_speed_kt, assigned_flight, runway_clearance
person role, operator, area
stand status, occupied_by, allocated_to, allocation_from, allocation_until, next_allocation
runway status, active_direction, use, closure
taxiway, area status, restriction
airport weather, runway_configuration

Attributes that point at another entity hold its ID: an aircraft's stand is stand:C2, a stand's occupied_by is aircraft:8851a4. Follow them with Retrieve an entity.

Positions are { "lat": …, "lon": … } in WGS 84 decimal degrees. The airfield endpoint returns GeoJSON, which orders coordinates longitude first; everything else names them.

Observations#

An observation is one fact, reported by one feed, about one entity, at one instant.

{
  "id": "obs_2Rn8Wd4yF6pe",
  "entity": "aircraft:8851a4",
  "feed": "feed_51d0a9e6f2",
  "kind": "allocation",
  "observed_at": "2026-11-23T01:36:12Z",
  "received_at": "2026-11-23T01:36:12.284Z",
  "data": { "stand": "stand:C2", "on_block_at": "2026-11-23T01:36:12Z" }
}

Feeds never write entities directly. Each source record goes through the feed's mapping, which turns it into one or more observations. Observations are immutable. A correction is a new observation, so the history of what was reported, and when, is never lost.

The kind says what sort of fact it is: position, status, schedule, allocation, weather or detection.

From observations to state#

An entity's state at an instant is the latest value of each attribute, taken from the observations about it up to that instant. Two feeds may report the same attribute; the stand allocation system and the ADS-B feed both know which stand an aircraft is on. When their observations disagree for the same instant, the feed with the higher priority wins. Set priority per feed when you register it.

Every entity carries provenance: for each attribute, the observation it came from.

"provenance": {
  "position": "obs_7Kc2Lq9vT0ma",
  "stand": "obs_2Rn8Wd4yF6pe",
  "flight": "obs_5Hv1Xb7sM3jk"
}

Retrieve the observation to see the feed, the timestamps and the raw record it was mapped from. When an operator asks why a board showed the wrong stand, this is the answer.

Revisions#

Each airport has a single counter, the revision, which increases by one for every observation admitted. Reads return the revision they were served at, and every event in a stream carries its revision as its ID. Two reads at the same revision see the same data, which is what makes replay and failover exact.