Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
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    "')
Esempio n. 4
0
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