Implementing getLastTrack function call

Hello,

I am new to Java NetBeans and wondering if you can help to implement the getLastTrack function call so that the long and lat of flight positions can be retrieved.

Below, I got the track request initiated, but is failing on the getLastTrack call. can you please help.

Many thanks,

Yiyan

GetLastTrackRequest ts= new GetLastTrackRequest();
ts.setIdent(“SWA2558”);
GetLastTrackResults tr = df.getLastTrack(ts); //the code error

GetLastTrack will not always have positional data available, particularly if the flight has already landed and there is another flight scheduled soon. It can also return an error if it does not have any positional data for the flight due to coverage issues, though that is not the case for that flight.

You can use GetHistorialTrack if you have the faFlightID of the specific flight you are interested in and it has already completed.

GetLastTrack has about an 20% error rate for me. I typically use the arrivals call for a particular airport and pull down a set of identifiers, then cycle through and pull up the tracks for the identifiers. Surprisingly consistent error rate. Funny thing is that I capture the flight identifiers that return errors, and have tried them again with the same result, yet I can pull up the tracks without an issue on the FlightAware site.

Since I care about sampling a large set of data, not having one particular track isn’t a big deal for me. But I could see how this would be frustrating for others that need the specific flight track.

Thank you both for your response.

I have only a few tail numbers that need to be tracked. And we will be on FlightAware Global as these numbers are private. and I was told that the Global will provide a better data.

As for the GetHistorialTrack call, we are only interested in the flight that is in the air. As Max advised, I will need to setup alerts for flights departure and arrival. and in between I will use GetLastTrack call.