def test_mercator_b_operation__defaults():
    lceaop = MercatorBConversion()
    assert lceaop.name == "unknown"
    assert lceaop.method_name == "Mercator (variant B)"
    assert _to_dict(lceaop) == {
        "Latitude of 1st standard parallel": 0.0,
        "Longitude of natural origin": 0.0,
        "False easting": 0.0,
        "False northing": 0.0,
    }
def test_mercator_b_operation():
    lceaop = MercatorBConversion(
        latitude_first_parallel=1,
        longitude_natural_origin=2,
        false_easting=3,
        false_northing=4,
    )
    assert lceaop.name == "unknown"
    assert lceaop.method_name == "Mercator (variant B)"
    assert _to_dict(lceaop) == {
        "Latitude of 1st standard parallel": 1.0,
        "Longitude of natural origin": 2.0,
        "False easting": 3.0,
        "False northing": 4.0,
    }
def _mercator(cf_params):
    """
    http://cfconventions.org/cf-conventions/cf-conventions.html#_mercator
    """
    if "scale_factor_at_projection_origin" in cf_params:
        return MercatorAConversion(
            latitude_natural_origin=cf_params.get("standard_parallel", 0.0),
            longitude_natural_origin=cf_params.get(
                "longitude_of_projection_origin", 0.0
            ),
            false_easting=cf_params.get("false_easting", 0.0),
            false_northing=cf_params.get("false_northing", 0.0),
            scale_factor_natural_origin=cf_params["scale_factor_at_projection_origin"],
        )
    return MercatorBConversion(
        latitude_first_parallel=cf_params.get("standard_parallel", 0.0),
        longitude_natural_origin=cf_params.get("longitude_of_projection_origin", 0.0),
        false_easting=cf_params.get("false_easting", 0.0),
        false_northing=cf_params.get("false_northing", 0.0),
    )