Exemplo n.º 1
0
def test_coordinate_system__from_string():
    cs = CoordinateSystem.from_string(
        '{"$schema":"https://proj.org/schemas/v0.2/projjson.schema.json",'
        '"type":"CoordinateSystem","subtype":"ellipsoidal",'
        '"axis":[{"name":"Geodetic latitude","abbreviation":"Lat",'
        '"direction":"north","unit":"degree"},'
        '{"name":"Geodetic longitude","abbreviation":"Lon",'
        '"direction":"east","unit":"degree"}],'
        '"id":{"authority":"EPSG","code":6422}}')
    assert cs.name == "ellipsoidal"
Exemplo n.º 2
0
def test_coordinate_system__from_string__invalid(invalid_cs_string):
    with pytest.raises(CRSError, match="Invalid coordinate system string"):
        CoordinateSystem.from_string(invalid_cs_string)
Exemplo n.º 3
0
def test_coordinate_system__from_string():
    cs = CoordinateSystem.from_string(_COORDINATE_SYSTEM_STR)
    assert cs.name == "ellipsoidal"
Exemplo n.º 4
0
def test_coordinate_system__equals():
    cs = CoordinateSystem.from_string(_COORDINATE_SYSTEM_STR)
    assert cs == _COORDINATE_SYSTEM_STR
    assert not cs != _COORDINATE_SYSTEM_STR
    assert cs != "invalid"