def test_crs_from_json(): aeqd_crs = CRS(proj="aeqd", lon_0=-80, lat_0=40.5) assert CRS.from_json(aeqd_crs.to_json()) == aeqd_crs
def test_crs_to_json(): aeqd_crs = CRS(proj="aeqd", lon_0=-80, lat_0=40.5) json_data = aeqd_crs.to_json() assert "ProjectedCRS" in json_data assert "\n" not in json_data
def test_crs_to_json__pretty__indenation(): aeqd_crs = CRS(proj="aeqd", lon_0=-80, lat_0=40.5) json_data = aeqd_crs.to_json(pretty=True, indentation=4) assert "ProjectedCRS" in json_data assert json_data.startswith('{\n "')
def test_coordinate_system_from_json(): # 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(aeqd_cs.to_json()) == aeqd_cs