def test_make_projected_crs(tmp_path): aeaop = AlbersEqualAreaConversion(0, 0) pc = ProjectedCRS(conversion=aeaop, name="Albers") assert pc.name == "Albers" assert pc.type_name == "Derived Projected CRS" assert pc.coordinate_operation == aeaop assert_can_pickle(pc, tmp_path)
def test_albers_equal_area_operation__defaults(): aeaop = AlbersEqualAreaConversion(latitude_first_parallel=1, latitude_second_parallel=2) assert aeaop.name == "unknown" assert aeaop.method_name == "Albers Equal Area" assert _to_dict(aeaop) == { "Easting at false origin": 0.0, "Latitude of 1st standard parallel": 1.0, "Latitude of 2nd standard parallel": 2.0, "Latitude of false origin": 0.0, "Longitude of false origin": 0.0, "Northing at false origin": 0.0, }
def _albers_conical_equal_area(cf_params): """ http://cfconventions.org/cf-conventions/cf-conventions.html#_albers_equal_area """ first_parallel, second_parallel = _get_standard_parallels( cf_params["standard_parallel"] ) return AlbersEqualAreaConversion( latitude_first_parallel=first_parallel, latitude_second_parallel=second_parallel or 0.0, latitude_false_origin=cf_params.get("latitude_of_projection_origin", 0.0), longitude_false_origin=cf_params.get("longitude_of_central_meridian", 0.0), easting_false_origin=cf_params.get("false_easting", 0.0), northing_false_origin=cf_params.get("false_northing", 0.0), )
def test_albers_equal_area_operation(): aeaop = AlbersEqualAreaConversion( latitude_first_parallel=1, latitude_second_parallel=2, latitude_false_origin=3, longitude_false_origin=4, easting_false_origin=5, northing_false_origin=6, ) assert aeaop.name == "unknown" assert aeaop.method_name == "Albers Equal Area" assert _to_dict(aeaop) == { "Easting at false origin": 5.0, "Latitude of 1st standard parallel": 1.0, "Latitude of 2nd standard parallel": 2.0, "Latitude of false origin": 3.0, "Longitude of false origin": 4.0, "Northing at false origin": 6.0, }
def test_make_projected_crs(): aeaop = AlbersEqualAreaConversion(0, 0) pc = ProjectedCRS(conversion=aeaop, name="Albers") assert pc.name == "Albers" assert pc.type_name == "Projected CRS" assert pc.coordinate_operation == aeaop