Skip to content

Commit

Permalink
Scale threshold to Globe radius in more projections.
Browse files Browse the repository at this point in the history
Fixes #1572, testing the example in the other projections as well.
  • Loading branch information
QuLogic committed Jul 12, 2020
1 parent f54d2f3 commit c09f1b9
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions lib/cartopy/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1638,9 +1638,15 @@ def __init__(self, central_longitude=0, false_easting=None,
false_northing=false_northing,
globe=globe)

# TODO: Let the globe return the semimajor axis always.
a = np.float(self.globe.semimajor_axis or WGS84_SEMIMAJOR_AXIS)
b = np.float(self.globe.semiminor_axis or a)

self._threshold = min(a, b) / 63.78137 # About 1e5 for defaults.

@property
def threshold(self):
return 1e5
return self._threshold


class EckertI(_Eckert):
Expand Down Expand Up @@ -1810,9 +1816,15 @@ def __init__(self, central_longitude=0, globe=None,
false_northing=false_northing,
globe=globe)

# TODO: Let the globe return the semimajor axis always.
a = np.float(self.globe.semimajor_axis or WGS84_SEMIMAJOR_AXIS)
b = np.float(self.globe.semiminor_axis or a)

self._threshold = min(a, b) / 63.78137 # About 1e5 for defaults.

@property
def threshold(self):
return 1e5
return self._threshold


class Robinson(_WarpedRectangularProjection):
Expand Down Expand Up @@ -2306,14 +2318,15 @@ def __init__(self, central_longitude=0.0, central_latitude=0.0,
maxs = np.max(coords, axis=1)
self._x_limits = mins[0], maxs[0]
self._y_limits = mins[1], maxs[1]
self._threshold = min(a, b) / 63.78137 # About 1e5 for defaults.

@property
def boundary(self):
return self._boundary

@property
def threshold(self):
return 1e5
return self._threshold

@property
def x_limits(self):
Expand Down

0 comments on commit c09f1b9

Please sign in to comment.