Skip to content

Commit ef9a980

Browse files
author
Jeff Whitaker
committed
do coastline clipping in stereographic coords for polar aeqd, laea.
1 parent 072ba45 commit ef9a980

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

examples/polarmaps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
# showing all four polar projections.
2727
for hem in ['North','South']:
2828
if hem == 'South':
29-
lon_0 = 130.
29+
lon_0 = -130.
3030
lon_0_ortho = lon_0 - 180.
3131
lat_0 = -90.
3232
# Lambert Azimuth bounding lat must not extend into opposite hem.
3333
bounding_lat = -0.01
3434
elif hem == 'North':
35-
lon_0 = -130.
35+
lon_0 = 130.
3636
lon_0_ortho = lon_0
3737
lat_0 = 90.
3838
# Lambert Azimuth bounding lat must not extend into opposite hem.

lib/mpl_toolkits/basemap/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,8 @@ def _readboundarydata(self,name):
981981
# coordinates, then transform back. This is
982982
# because these projections are only defined on a hemisphere, and
983983
# some boundary features (like Eurasia) would be undefined otherwise.
984-
if self.projection in ['ortho','gnom','nsper'] and name == 'gshhs':
984+
tostere = ['ortho','gnom','nsper','nplaea','npaeqd','splaea','spaeqd']
985+
if self.projection in tostere and name == 'gshhs':
985986
containsPole = True
986987
lon_0=self.projparams['lon_0']
987988
lat_0=self.projparams['lat_0']
@@ -1102,8 +1103,7 @@ def _readboundarydata(self,name):
11021103
# to map projection coordinates.
11031104
# special case for ortho/gnom/nsper, compute coastline polygon
11041105
# vertices in stereographic coords.
1105-
if name == 'gshhs' and self.projection in\
1106-
['ortho','gnom','nsper']:
1106+
if name == 'gshhs' and self.projection in tostere:
11071107
b[:,0], b[:,1] = maptran(b[:,0], b[:,1])
11081108
else:
11091109
b[:,0], b[:,1] = self(b[:,0], b[:,1])
@@ -1120,7 +1120,7 @@ def _readboundarydata(self,name):
11201120
# for ortho/gnom/nsper projection, all points
11211121
# outside map projection region are eliminated
11221122
# with the above step, so we're done.
1123-
if self.projection in ['ortho','gnom','nsper']:
1123+
if self.projection in tostere:
11241124
polygons.append(list(zip(bx,by)))
11251125
polygon_types.append(type)
11261126
continue
@@ -1147,7 +1147,7 @@ def _readboundarydata(self,name):
11471147
# if projection in ['ortho','gnom','nsper'],
11481148
# transform polygon from stereographic
11491149
# to ortho/gnom/nsper coordinates.
1150-
if self.projection in ['ortho','gnom','nsper']:
1150+
if self.projection in tostere:
11511151
# if coastline polygon covers more than 99%
11521152
# of map region for fulldisk projection,
11531153
# it's probably bogus, so skip it.

0 commit comments

Comments
 (0)