1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! # Location
//! This module specifies two custom structures for the query methods: a ```Point``` and a ```BBox```.
//! A ```Point``` specifies a point in geographical space using latitude and longitude coordinates (
//! e.g. St. Gallen main station -> 47.423, 9.370).
//! ```rust, no_run
//! use meteomatics::Point;
//!
//! let st_gallen = Point { lat: 47.423, lon: 9.370};
//! ````
//!
//! A ```BBox```specifies the bounding box in geographical space for a grid query. The box is defined
//! on the coordinates of the upper left (latitude max value, longitue min value) and lower right points
//! (latitude min value, longitude max value). The BBox further requires the definition of the desired
//! output resolution of the grid (latitude resolution, longitude resolution).
//! ```rust, no_run
//! use meteomatics::BBox;
//!
//! let st_gallen_grid = BBox {
//! lat_min: 47.423,
//! lat_max: 47.424,
//! lon_min: 9.369,
//! lon_max: 9.370,
//! lat_res: 0.0005,
//! lon_res: 0.0005
//! };
//! ```
use fmt;
/// Define a location using its latitude and longitude coordinates. This is used in the generation of
/// the query in ```query_time_series()```.
/// Define an area of interest by specifying a bounding box with coordinates at the upper left (lat_max,
/// lon_min) and lower right locations (lat_min, lon_max). This is used in the generation of the query
/// in ```query_grid()``` and ```query_grid_time_series()```.
/// This Display Trait implements the correct way of combining latitude and longitude coordinates for
/// a Point. According to the MeteoMatics API specifications.
// TODO: Think about the number of significant digits and rounding/imprecision issues.
/// This Display Trait implements the correct way of combining the bounding box coordinates.