Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions lib/cartopy/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,30 @@ def transform_points(self, src_crs, x, y, z=None, trap=False):
return result


class WinkelTripel(_WarpedRectangularProjection):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do any of the nan handling here like we are doing in the Robinson projection? i.e. should this subclass Robinson instead if it is similar to that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to generate maps containing maps with no problem. Are there other tests for nans that I would need to do?

"""
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
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/cartopy/tests/mpl/test_mpl_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading