Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added winkel tripel projection class #2442

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
27 changes: 27 additions & 0 deletions lib/cartopy/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,33 @@ 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),
('lat_0', 0.0)]
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 pass in the lat_0 parameter even if 0 is the default, and does that even work, it looks like it is lat_1 in the documentation: https://proj.org/en/9.4/operations/projections/wintri.html


super(WinkelTripel, self).__init__(proj4_params,
AgentOxygen marked this conversation as resolved.
Show resolved Hide resolved
central_longitude,
globe=globe)

@property
def threshold(self):
return 1e4


class InterruptedGoodeHomolosine(Projection):
"""
Composite equal-area projection emphasizing either land or
Expand Down