api icon indicating copy to clipboard operation
api copied to clipboard

Use case example: findmyplane.live

Open hankhank10 opened this issue 4 years ago • 5 comments

Hello, I wanted to first thank you for this API which I have found really useful and had a lot of fun playing with today.

Second, I wanted to flag to you that I have used this in an example project called https://FindMyPlane.live. This is a client which users can run on their own computers which sends their location sim data to my server which then displays it in a pretty nice graphical web interface viewable anywhere via a browser. I have used your api to include traffic of where other players are as well.

You can view an example of my flight tracking at https://findmyplane.live/view/DUMMY and all the traffic at https://findmyplane.live/view_world. The github repo is https://github.com/hankhank10/findmyplane-server

Finally, I have two feature suggestions if I may?

Option to strip out planes on the ground The first is, as you can see from the below screenshot many of the planes displayed are in fact on the ground at airports.

This may be useful to some users but I think most would prefer to have the option to exclude from the view planes which are stationary on the ground. This would be particularly helpful given for performance reasons (and the fact that the API caps for a single request) I display only the first 100 planes in the map bounds. Given the altitude returned by the API is altitude above sea level (I presume?) there's no straightforward way to strip these out other than running each lat/lon to see if it's near an airport, pulling the altitude of that airport and comparing - which is a lot to run on the client side.

Could I suggest including a field in the JSON output called "stationary_on_ground" which returns true if the landing gear is down and speed is 0? And allowing users of the API to query against that field?

Ability for users to find their plane I would love to give your users the option to follow their own flight in the same way that people running my client software can. At the moment there doesn't seem to be an easy way for users to identify their flight other than the id (which given it's long I presume is not meant to be user facing) or the "flight" field which doesn't necessarily seem to be unique and seems can be empty. Would you consider adding a user-friendly ident or code which they could use to identify their flight? For my client I use a random 5 character alpha/numerical code but you will of course have your own ideas about how best to implement this.

Thanks again for this great project!

hankhank10 avatar Jan 17 '21 19:01 hankhank10

Hey, I will add the check if an aircraft is on the ground by sending it in our reporting from the aircraft.

It is already possible to find a user's current flight by using their flight number. The flight numbers are unique while being in use. Once a user disconnects the flight number can be reused again after 6 minutes. Also, users can only connect to our system if their flight number is not in use. Take a look at the /find endpoint

Also, take a look at our reference map which shows all aircraft by following up on the pagination and has a search bar: https://github.com/flybywiresim/map

nistei avatar Jan 19 '21 21:01 nistei

Perfect, thank you.

Very helpful to know about the unique flight number.

To be honest I am ok from a user perspective with the 100 limit on flights returned per api request and don’t propose to iterate through pages as I think it will just display too much data for my purposes in any case.

Thanks!

On Tue, 19 Jan 2021 at 21:45, Niklas Steiner [email protected] wrote:

Hey, I will add the check if an aircraft is on the ground by sending it in our reporting from the aircraft.

It is already possible to find a user's current flight by using their flight number. The flight numbers are unique while being in use. Once a user disconnects the flight number can be reused again after 6 minutes. Also, users can only connect to our system if their flight number is not in use. Take a look at the /find endpoint https://api.flybywiresim.com/api/#/TELEX/TelexConnectionController_findConnection

Also, take a look at our reference map which shows all aircraft by following up on the pagination and has a search bar: https://github.com/flybywiresim/map

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/flybywiresim/api/issues/64#issuecomment-763161140, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVMWKC7PI6HAAKJEMQ2VDS2X4ODANCNFSM4WGLMPWQ .

hankhank10 avatar Jan 19 '21 21:01 hankhank10

I've updated the site so that, in addition to displaying traffic from your API, the user can specify that they wish to follow the flight using a Fly By Wire flight number:

Example path: https://findmyplane.live/view/[a flight number actually in use]

At the moment it doesn't support 5 character flight numbers as I am using that to work out whether the page should query my API (since my ident codes are always 5 characters) or your API.

hankhank10 avatar Jan 19 '21 23:01 hankhank10

@hankhank10 Just a heads up, the GET /txcxn/_find endpoint changed slightly to return an additional full match if found instead of all possible matches.

nistei avatar Feb 01 '21 18:02 nistei

Thank you @nistei, I appreciate the heads up. I have tested and my integration still works fine with this change.

FWIW I actually prefer the exact response rather than the list for my purpose and - were one available - I would make use of an endpoint which returned only results which exactly match the flight number or 404 otherwise (similar to how the /txcxn/{id} works now.

hankhank10 avatar Feb 01 '21 18:02 hankhank10