1use crate::ellipsoid::Ellipsoid;
4
5pub trait Projection: Send + Sync {
7 fn projected_to_rad(&self, x: f64, y: f64) -> (f64, f64);
9
10 fn rad_to_projected(&self, lon: f64, lat: f64) -> (f64, f64);
12
13 fn projected_to_deg(&self, x: f64, y: f64) -> (f64, f64) {
15 let tmp = self.projected_to_rad(x, y);
16 (tmp.0.to_degrees(), tmp.1.to_degrees())
17 }
18
19 fn deg_to_projected(&self, lon: f64, lat: f64) -> (f64, f64) {
21 self.rad_to_projected(lon.to_radians(), lat.to_radians())
22 }
23}
24
25pub trait PseudoSerialize {
26 fn to_constructed(&self) -> String;
27}
28
29pub trait DbContstruct {
30 fn from_database_params(params: &[(u32, f64)], ellipsoid: &Ellipsoid) -> Self;
31}
32
33pub trait GetterContstruct: Sized {
34 fn with_db_getter<G>(getter: G, ellipsoid: &Ellipsoid) -> Option<Self>
35 where
36 G: FnMut(u32) -> Option<f64>;
37}