What’s the most efficient way of getting the last known (not projected) position of a flight.
I could use “getLastTrack” and loop through all records until I get to the most recent non-projected position, but getLastTrack is too slow because it returns a large amount of data.
I could use “inflight” which is fast, but the location returned is sometimes a projected one which doesn’t help me.
What do you suggest?
You can do something like:
SearchBirdseyePositions(“{= fp yyyyyyyyy} {> clock xxxxxxxx} {!= updateType P}”, false, 50, 0);
Pass the faFlightId of the flight you’re interested in, and the last epoch clock time of the last position that you’ve already received. Unfortunately, you can’t specify howMany=1 to only get the last one because the order returned is not necessarily sorted with newest first. But that will let you retrieve all non-projected positions as they come in.