busstoptaktik / geodesy

Rust geodesy
Apache License 2.0
63 stars 6 forks source link

LAEA projection does not preserve latitude on inverse transformation #89

Closed Maximkaaa closed 6 months ago

Maximkaaa commented 6 months ago

This fails with longitude being equal before and after transformations, but latitude == 0.

#[test]
fn lambert_projection() {
    let mut ctx = Minimal::new();
    let op = ctx.op("laea lon_0=10 lat_0=52 x_0=4321000 y_0=3210000").unwrap();
    let mut data = [Coor2D::geo(52.0, 10.0)];
    let clone = data.clone();
    ctx.apply(op, Fwd, &mut data).unwrap();
    ctx.apply(op, Inv, &mut data).unwrap();
    assert_eq!(data, clone);
}