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"
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)
def test_coordinate_system__from_string(): cs = CoordinateSystem.from_string(_COORDINATE_SYSTEM_STR) assert cs.name == "ellipsoidal"
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"