{ "name": "Northing", "abbreviation": "N", "direction": "north", "unit": "metre", }, ], } @pytest.mark.parametrize( "user_input", [ CS_JSON_DICT, json.dumps(CS_JSON_DICT), CoordinateSystem.from_json_dict(CS_JSON_DICT), ], ) def test_coordinate_system__from_user_input(user_input): assert CoordinateSystem.from_user_input( user_input) == CoordinateSystem.from_json_dict(CS_JSON_DICT) @pytest.mark.parametrize( "user_input", [ 7001, ("EPSG", 7001), "urn:ogc:def:ellipsoid:EPSG::7001", Ellipsoid.from_epsg(7001), Ellipsoid.from_epsg(7001).to_json_dict(),
def test_coordinate_system__from_user_input(user_input): assert CoordinateSystem.from_user_input( user_input) == CoordinateSystem.from_json_dict(CS_JSON_DICT)
def test_coordinate_system_from_json_dict(): # separate test from other properties due to # https://github.com/OSGeo/PROJ/issues/1818 aeqd_cs = CRS(proj="aeqd", lon_0=-80, lat_0=40.5).coordinate_system assert CoordinateSystem.from_json_dict(aeqd_cs.to_json_dict()) == aeqd_cs