opensky_network/
bounding_box.rs

1#[derive(Debug, Clone, Copy)]
2/// Represents a certain area defined by a bounding box of WGS84 coordinates.
3pub struct BoundingBox {
4    /// lower bound for the latitude in decimal degrees
5    pub lat_min: f32,
6    /// upper bound for the latitude in decimal degrees
7    pub lat_max: f32,
8    /// lower bound for the longitude in decimal degrees
9    pub long_min: f32,
10    /// upper bound for the longitude in decimal degrees
11    pub long_max: f32,
12}
13
14impl BoundingBox {
15    /// Creates a new BoundingBox with the given coordinates.
16    pub fn new(lat_min: f32, lat_max: f32, long_min: f32, long_max: f32) -> Self {
17        Self {
18            lat_min,
19            lat_max,
20            long_min,
21            long_max,
22        }
23    }
24}