def test_lambert_conformat_conic_1sp_operation__defaults():
    aeaop = LambertConformalConic1SPConversion()
    assert aeaop.name == "unknown"
    assert aeaop.method_name == "Lambert Conic Conformal (1SP)"
    assert _to_dict(aeaop) == {
        "Latitude of natural origin": 0.0,
        "Longitude of natural origin": 0.0,
        "False easting": 0.0,
        "False northing": 0.0,
        "Scale factor at natural origin": 1.0,
    }
def test_lambert_conformat_conic_1sp_operation():
    aeaop = LambertConformalConic1SPConversion(
        latitude_natural_origin=1,
        longitude_natural_origin=2,
        false_easting=3,
        false_northing=4,
        scale_factor_natural_origin=0.5,
    )
    assert aeaop.name == "unknown"
    assert aeaop.method_name == "Lambert Conic Conformal (1SP)"
    assert _to_dict(aeaop) == {
        "Latitude of natural origin": 1.0,
        "Longitude of natural origin": 2.0,
        "False easting": 3.0,
        "False northing": 4.0,
        "Scale factor at natural origin": 0.5,
    }
Exemplo n.º 3
0
def _lambert_conformal_conic(cf_params):
    """
    http://cfconventions.org/cf-conventions/cf-conventions.html#_lambert_conformal
    """
    first_parallel, second_parallel = _get_standard_parallels(
        cf_params["standard_parallel"]
    )
    if second_parallel is not None:
        return LambertConformalConic2SPConversion(
            latitude_first_parallel=first_parallel,
            latitude_second_parallel=second_parallel,
            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),
        )
    return LambertConformalConic1SPConversion(
        latitude_natural_origin=first_parallel,
        longitude_natural_origin=cf_params.get("longitude_of_central_meridian", 0.0),
        false_easting=cf_params.get("false_easting", 0.0),
        false_northing=cf_params.get("false_northing", 0.0),
    )