diff --git a/lib/cartopy/crs.py b/lib/cartopy/crs.py index 9d3c176bb..6312dc3d6 100644 --- a/lib/cartopy/crs.py +++ b/lib/cartopy/crs.py @@ -1730,12 +1730,20 @@ def y_limits(self): class LambertCylindrical(_RectangularProjection): - def __init__(self, central_longitude=0.0, globe=None): + def __init__(self, central_longitude=0.0, globe=None, + latitude_true_scale=0.0): globe = globe or Globe(semimajor_axis=WGS84_SEMIMAJOR_AXIS) proj4_params = [('proj', 'cea'), ('lon_0', central_longitude), + ('lat_ts', latitude_true_scale), ('to_meter', math.radians(1) * ( globe.semimajor_axis or WGS84_SEMIMAJOR_AXIS))] - super().__init__(proj4_params, 180, math.degrees(1), globe=globe) + stretch_factor = np.cos(np.deg2rad(latitude_true_scale)) ** 2 + super().__init__( + proj4_params, + 180 * np.sqrt(stretch_factor), + math.degrees(1) / np.sqrt(stretch_factor), + globe=globe, + ) class LambertConformal(Projection): diff --git a/lib/cartopy/tests/mpl/test_gridliner.py b/lib/cartopy/tests/mpl/test_gridliner.py index 661440707..b0b680d2c 100644 --- a/lib/cartopy/tests/mpl/test_gridliner.py +++ b/lib/cartopy/tests/mpl/test_gridliner.py @@ -31,6 +31,9 @@ ccrs.AzimuthalEquidistant, ccrs.LambertConformal, ccrs.LambertCylindrical, + pytest.param((ccrs.LambertCylindrical, dict(latitude_true_scale=45)), + id='GallPeters'), + ccrs.LambertCylindrical, ccrs.Mercator, ccrs.Miller, ccrs.Mollweide,