osm_io/osm/model/
coordinate.rs

1#[derive(Debug, Clone, PartialEq)]
2pub struct Coordinate {
3    lat: f64,
4    lon: f64,
5}
6
7impl Coordinate {
8    pub fn new(lat: f64, lon: f64) -> Coordinate {
9        Coordinate {
10            lat,
11            lon,
12        }
13    }
14
15    pub fn lat(&self) -> f64 {
16        self.lat
17    }
18
19    pub fn lat7(&self) -> i64 {
20        (self.lat * 1E7).round() as i64
21    }
22
23    pub fn lon(&self) -> f64 {
24        self.lon
25    }
26
27    pub fn lon7(&self) -> i64 {
28        (self.lon * 1E7).round() as i64
29    }
30}