3.2.3.1.13. Sub step 11.1 - Delete temporary expanded flight table
First sub step is used to clear the content of the temporary expanded flight table, in which the calculation will take place. The executed code is:
'------------------------------------------------------------------------------
DoCmd.DeleteObject acTable, "Amoc_ExpandedFlight"
DoCmd.TransferDatabase acImport, "Microsoft Access", CurrentDb.Name, acTable, "Amoc_ExpandedFlight", "ModelFlight", True
'------------------------------------------------------------------------------
3.2.3.1.14. Sub step 11.2 - Copy all flight legs to the expanded flight table
In this sub step all flight legs from the flight table will be appended to the temporary expanded flight table, which is empty. It is necessary to use this temporary table, even if the table has the same structure than the flight table, because the UniqueID field must be filled with consecutive values for each flight and that flight must be sorted ascending by EventTime field values. So finally, in Amoc_ExpandedFlight table, each flight will have ordered flight legs and the unique identifier will have consecutive values in ascending order. The appending query SQL code is:
'------------------------------------------------------------------------------
INSERT INTO Amoc_ExpandedFlight ( TrafficId, CallSign, EventTime, Latitude, Longitude, FlightLevel, GroundSpeed, Source )
SELECT AmocFlight.TrafficId, AmocFlight.CallSign, AmocFlight.EventTime, AmocFlight.Latitude, AmocFlight.Longitude, AmocFlight.FlightLevel, AmocFlight.GroundSpeed, AmocFlight.Source
FROM AmocFlight
ORDER BY AmocFlight.TrafficId, AmocFlight.EventTime;
'------------------------------------------------------------------------------
3.2.3.1.15. Sub step 11.3 - Calculate the average speed and the climb/descent rate
To calculate these two values for each pair of two consecutive flight legs belonging to the same flight, the list of all these pairs is needed. A selecting query is used (AmocFlightUniqueIdPairs). This query will return for each two consecutive flight legs that belong to the same flight, the next values:
UID1 -first leg unique identifier UID2 - second leg unique identifier EventTime1 -first leg event time EventTime2 - second leg event time Lat1 -first leg latitude Lon1 -first leg longitude Lat2 - second leg latitude Lon2 - second leg longitude Level1 - first leg flight level Level2 - second leg flight level
The selecting query SQL code is:
'------------------------------------------------------------------------------
SELECT Amoc_ExpandedFlight.UniqueID AS UID1, Amoc_ExpandedFlight_1.UniqueID AS UID2, Amoc_ExpandedFlight.EventTime AS EventTime1, Amoc_ExpandedFlight_1.EventTime AS EventTime2, Amoc_ExpandedFlight.Latitude AS Lat1, Amoc_ExpandedFlight.Longitude AS Lon1, Amoc_ExpandedFlight_1.Latitude AS Lat2, Amoc_ExpandedFlight_1.Longitude AS Lon2, Amoc_ExpandedFlight.FlightLevel 中国航空网 www.aero.cn 航空翻译 www.aviation.cn 本文链接地址:AERO2K Flight Movement Inventory Project Report(52)