コード例 #1
0
def test_geodetic_rectifying(geodetic_lat, rectifying_lat):
    assert pm.geodetic2rectifying(geodetic_lat) == approx(rectifying_lat)
    assert pm.geodetic2rectifying(radians(geodetic_lat),
                                  deg=False) == approx(radians(rectifying_lat))

    assert pm.rectifying2geodetic(rectifying_lat) == approx(geodetic_lat)
    assert pm.rectifying2geodetic(radians(rectifying_lat),
                                  deg=False) == approx(radians(geodetic_lat))
コード例 #2
0
def test_badvals(lat):
    # geodetic_isometric is not included on purpose
    with pytest.raises(ValueError):
        pm.geodetic2geocentric(lat, 0)
    with pytest.raises(ValueError):
        pm.geocentric2geodetic(lat, 0)
    with pytest.raises(ValueError):
        pm.geodetic2conformal(lat)
    with pytest.raises(ValueError):
        pm.conformal2geodetic(lat)
    with pytest.raises(ValueError):
        pm.geodetic2rectifying(lat)
    with pytest.raises(ValueError):
        pm.rectifying2geodetic(lat)
    with pytest.raises(ValueError):
        pm.geodetic2authalic(lat)
    with pytest.raises(ValueError):
        pm.authalic2geodetic(lat)
    with pytest.raises(ValueError):
        pm.geodetic2parametric(lat)
    with pytest.raises(ValueError):
        pm.parametric2geodetic(lat)
コード例 #3
0
def test_numpy_geodetic_rectifying():
    pytest.importorskip("numpy")
    assert pm.geodetic2rectifying([45, 0]) == approx([44.855682, 0])
    assert pm.rectifying2geodetic([44.855682, 0]) == approx([45, 0])