コード例 #1
0
def test_geodetic_parametric(geodetic_lat, parametric_lat):
    assert pm.geodetic2parametric(geodetic_lat) == approx(parametric_lat)
    assert pm.geodetic2parametric(radians(geodetic_lat),
                                  deg=False) == approx(radians(parametric_lat))

    assert pm.parametric2geodetic(parametric_lat) == approx(geodetic_lat)
    assert pm.parametric2geodetic(radians(parametric_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_parametric():
    pytest.importorskip("numpy")
    assert pm.geodetic2parametric([45, 0]) == approx([44.9037878, 0])
    assert pm.parametric2geodetic([44.9037878, 0]) == approx([45, 0])