pub struct OpenSkyApi { /* private fields */ }Expand description
The OpenSky Network API https://openskynetwork.github.io/opensky-api
Implementations§
Source§impl OpenSkyApi
impl OpenSkyApi
Sourcepub fn with_login(username: String, password: String) -> Self
pub fn with_login(username: String, password: String) -> Self
Creates a new OpenSkyApi instance with the provided username and password
Sourcepub fn get_states(&self) -> StateRequestBuilder
pub fn get_states(&self) -> StateRequestBuilder
Creates a new StateRequestBuilder which can be used to create StateRequests
Sourcepub fn get_flights(&self, begin: u64, end: u64) -> FlightsRequestBuilder
pub fn get_flights(&self, begin: u64, end: u64) -> FlightsRequestBuilder
Creates a new FlightsRequestBuilder using the given time interval. The beginning and ending times are numbers that represent times in seconds since the Unix Epoch.
The interval must not span greater than 2 hours, otherwise the request will fail.
Sourcepub fn get_tracks(&self, icao24: String) -> TrackRequestBuilder
pub fn get_tracks(&self, icao24: String) -> TrackRequestBuilder
Create a new TrackRequestBuilder for the given icao24 address of a certain aircraft.
In contrast to state vectors, trajectories do not contain all information we have about the flight, but rather show the aircraft’s general movement pattern. For this reason, waypoints are selected among available state vectors given the following set of rules:
- The first point is set immediately after the the aircraft’s expected departure, or after the network received the first position when the aircraft entered its reception range.
- The last point is set right before the aircraft’s expected arrival, or the aircraft left the networks reception range.
- There is a waypoint at least every 15 minutes when the aircraft is in-flight.
- A waypoint is added if the aircraft changes its track more than 2.5°.
- A waypoint is added if the aircraft changes altitude by more than 100m (~330ft).
- A waypoint is added if the on-ground state changes.
Tracks are strongly related to flights. Internally, we compute flights and tracks within the same processing step. As such, it may be beneficial to retrieve a list of flights with the API methods from above, and use these results with the give time stamps to retrieve detailed track information.