d3_geo_rs 0.1.5

A port of D3/d3-geo
Documentation
#[cfg(not(tarpaulin_include))]
mod invert {

    use geo_types::Coord;

    use d3_geo_rs::projection::azimuthal_equal_area::AzimuthalEqualArea;
    use d3_geo_rs::projection::azimuthal_equidistant::AzimuthalEquiDistant;
    use d3_geo_rs::projection::equal_area::EqualArea;
    use d3_geo_rs::projection::equality::projection_equal;
    use d3_geo_rs::projection::equirectangular::Equirectangular;
    use d3_geo_rs::projection::gnomic::Gnomic;
    use d3_geo_rs::projection::mercator::Mercator;
    use d3_geo_rs::projection::mercator_transverse::MercatorTransverse;
    use d3_geo_rs::projection::orthographic::Orthographic;
    use d3_geo_rs::projection::stereographic::Stereographic;
    use d3_geo_rs::projection::Build;
    use d3_geo_rs::projection::RawBase;
    use d3_geo_rs::stream::DrainStub;
    use d3_geo_rs::Transform;

    fn symetric_invert<PM>(pm: PM)
    where
        PM: Transform<T = f64>,
    {
        for p in [
            &Coord {
                x: 0.0f64,
                y: 0.0f64,
            },
            &Coord {
                x: 30.3f64,
                y: 24.1f64,
            },
            &Coord {
                x: -10f64,
                y: 42f64,
            },
            &Coord {
                x: -2.0f64,
                y: -5.0f64,
            },
        ] {
            assert!(projection_equal(&pm, p, &pm.transform(p), None));
        }
    }

    #[test]
    fn azimuthal_equal_area() {
        let a = AzimuthalEqualArea::<DrainStub<f64>, f64>::builder().build();
        symetric_invert(a);
    }

    #[test]
    fn azimuthal_equidistant() {
        let a = AzimuthalEquiDistant::<DrainStub<f64>, f64>::builder().build();
        symetric_invert(a);
    }

    #[test]
    fn conic_equal_area() {
        let c = EqualArea::<DrainStub<f64>, f64>::builder().build();
        symetric_invert(c);
    }

    #[test]
    fn equirectangular() {
        let e = Equirectangular::<DrainStub<f64>, f64>::builder().build();
        symetric_invert(e);
    }

    #[test]
    fn gnomic() {
        let g = Gnomic::<DrainStub<f64>, f64>::builder().build();
        symetric_invert(g);
    }

    #[test]
    fn orthographic() {
        let o = Orthographic::<DrainStub<f64>, f64>::builder().build();
        symetric_invert(o);
    }

    #[test]
    fn mercator() {
        let m = Mercator::<DrainStub<f64>>::builder().build();
        symetric_invert(m);
    }

    #[test]
    fn mercator_traverse() {
        let m = MercatorTransverse::<DrainStub<f64>>::builder().build();
        symetric_invert(m);
    }

    #[test]
    fn stereographic() {
        let s = Stereographic::<DrainStub<f64>, f64>::builder().build();
        symetric_invert(s);
    }
}