Hi,
we were facing exactly the same problems. Here is a wrap-up of the algorithm that we use. It mainly relies on an aircraft's average velocity. This approach turned out to be quite robust when it comes to different types of vehicles.
(We aggregate ADS-B information into a structure which we call "state vector". You could replace "state" with "ADS-B position report".)
For each aircraft, process its states ordered by time and apply the following rules:
- For each state, compute the inter-message-arrival-time and velocity to the preceding one (based on time of last position update and actual position)
- Compute threshold Tau = median(all_velocities)/4
- Each state with inter-arrival-time >600s and velocity < Tau is a departure state
- Each state preceding a departure state is an arrival state
- For each departure state assign the nearest airport with a 2D distance <15km and altitude difference <2000m
- For each arrival state assign the nearest airport with a 2D distance <30km and altitude difference <2500m
- A flight encompasses all states between departure and arrival
In this context,
arrival state is the state with smallest time interval to the expected arrival at the airport. The
departure state is the first state of the aircraft after the estimated departure.
Actual departures and arrivals are hard to define and, as you already pointed out, might not have been captured by our receivers.
Hope that helps!
Markus