bauerj / flightsearch-co2

Compare CO2 emissions for your flights on Google Flights ✈
Apache License 2.0
0 stars 3 forks source link

Airplane types are not unique in flight results #6

Open bauerj opened 4 years ago

bauerj commented 4 years ago

Google Flights shows which plane is planned to be used for a given flight. However, this in not really precise as one plane could match multiple planes in Atmosfair's API.

For example:

It is not clear which plane should be used to calculate the specific emissions. Currently, no plane type is sent in this case which results in a higher margin of error for the emission estimation.

mmathea-ep commented 4 years ago

One possible solution is to use the flight number instead of the planes type. A request with flightnumber looks like { "accountId": „...", "password":"...", "flights": [ { "flightNumber":"UA988", "departureDate":"2018-10-03", "passengerCount": 1, "flightCount": 2, "travelClass": "B", "charter": false } ] }

If no response is received or the response is insufficent it is okay to approximate or more precisely use the current logic.

mmathea-ep commented 4 years ago

For the current case a mapping is a better solution than to use no planetype. I will add a mapping to the current candidates.