@@ -1310,12 +1310,27 @@ def y_limits(self):
13101310class Stereographic (Projection ):
13111311 def __init__ (self , central_latitude = 0.0 , central_longitude = 0.0 ,
13121312 false_easting = 0.0 , false_northing = 0.0 ,
1313- true_scale_latitude = None , globe = None ):
1313+ true_scale_latitude = None ,
1314+ scale_factor = None , globe = None ):
13141315 proj4_params = [('proj' , 'stere' ), ('lat_0' , central_latitude ),
13151316 ('lon_0' , central_longitude ),
13161317 ('x_0' , false_easting ), ('y_0' , false_northing )]
1317- if true_scale_latitude :
1318+
1319+ if true_scale_latitude is not None :
1320+ if central_latitude not in (- 90. , 90. ):
1321+ warnings .warn ('"true_scale_latitude" parameter is only used '
1322+ 'for polar stereographic projections. Consider '
1323+ 'the use of "scale_factor" instead.' )
13181324 proj4_params .append (('lat_ts' , true_scale_latitude ))
1325+
1326+ if scale_factor is not None :
1327+ if true_scale_latitude is not None :
1328+ raise ValueError ('It does not make sense to provide both '
1329+ '"scale_factor" and "true_scale_latitude". '
1330+ 'Ignoring "scale_factor".' )
1331+ else :
1332+ proj4_params .append (('k_0' , scale_factor ))
1333+
13191334 super (Stereographic , self ).__init__ (proj4_params , globe = globe )
13201335
13211336 # TODO: Let the globe return the semimajor axis always.
@@ -1358,17 +1373,23 @@ def y_limits(self):
13581373
13591374
13601375class NorthPolarStereo (Stereographic ):
1361- def __init__ (self , central_longitude = 0.0 , globe = None ):
1376+ def __init__ (self , central_longitude = 0.0 , true_scale_latitude = None ,
1377+ globe = None ):
13621378 super (NorthPolarStereo , self ).__init__ (
13631379 central_latitude = 90 ,
1364- central_longitude = central_longitude , globe = globe )
1380+ central_longitude = central_longitude ,
1381+ true_scale_latitude = true_scale_latitude , # None is +90
1382+ globe = globe )
13651383
13661384
13671385class SouthPolarStereo (Stereographic ):
1368- def __init__ (self , central_longitude = 0.0 , globe = None ):
1386+ def __init__ (self , central_longitude = 0.0 , true_scale_latitude = None ,
1387+ globe = None ):
13691388 super (SouthPolarStereo , self ).__init__ (
13701389 central_latitude = - 90 ,
1371- central_longitude = central_longitude , globe = globe )
1390+ central_longitude = central_longitude ,
1391+ true_scale_latitude = true_scale_latitude , # None is -90
1392+ globe = globe )
13721393
13731394
13741395class Orthographic (Projection ):
0 commit comments