diff --git a/lib/cartopy/crs.py b/lib/cartopy/crs.py index 07fce8e0c..8256e5c33 100644 --- a/lib/cartopy/crs.py +++ b/lib/cartopy/crs.py @@ -2539,6 +2539,30 @@ def transform_points(self, src_crs, x, y, z=None, trap=False): return result +class WinkelTripel(_WarpedRectangularProjection): + """ + A Winkel-Tripel projection. + + Compromise modified azimuthal projection that is less distorted + and more area-accurate. It is comparable to the Robinson + projection in both appearance and popularity. + + The National Geographic Society uses the Winkel-Tripel projection + for most of the maps they produce. + """ + + def __init__(self, central_longitude=0.0, globe=None): + globe = globe or Globe(semimajor_axis=WGS84_SEMIMAJOR_AXIS) + proj4_params = [('proj', 'wintri'), + ('lon_0', central_longitude)] + + super().__init__(proj4_params, central_longitude, globe=globe) + + @property + def threshold(self): + return 1e4 + + class InterruptedGoodeHomolosine(Projection): """ Composite equal-area projection emphasizing either land or diff --git a/lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/test_global_map_WinkelTripel.png b/lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/test_global_map_WinkelTripel.png new file mode 100644 index 000000000..424e955e1 Binary files /dev/null and b/lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/test_global_map_WinkelTripel.png differ diff --git a/lib/cartopy/tests/mpl/test_mpl_integration.py b/lib/cartopy/tests/mpl/test_mpl_integration.py index df726ac13..7eb64d213 100644 --- a/lib/cartopy/tests/mpl/test_mpl_integration.py +++ b/lib/cartopy/tests/mpl/test_mpl_integration.py @@ -196,6 +196,7 @@ def test_simple_global(): (ccrs.ObliqueMercator, dict(azimuth=90., central_latitude=-22)), id='ObliqueMercator_rotated', ), + ccrs.WinkelTripel, ]) @pytest.mark.mpl_image_compare(style='mpl20') def test_global_map(proj):