def test_simple(self): # Check that a projection set up with all the defaults is correctly # converted to a cartopy CRS. merc_cs = Mercator() res = merc_cs.as_cartopy_crs() expected = ccrs.Mercator(globe=ccrs.Globe()) self.assertEqual(res, expected)
def test_extra_kwargs(self): # Check that a projection with non-default values is correctly # converted to a cartopy CRS. longitude_of_projection_origin = 90.0 true_scale_lat = 14.0 ellipsoid = GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.909) merc_cs = Mercator( longitude_of_projection_origin, ellipsoid=ellipsoid, standard_parallel=true_scale_lat, ) expected = ccrs.Mercator( central_longitude=longitude_of_projection_origin, globe=ccrs.Globe( semimajor_axis=6377563.396, semiminor_axis=6356256.909, ellipse=None, ), latitude_true_scale=true_scale_lat, ) res = merc_cs.as_cartopy_crs() self.assertEqual(res, expected)
def test_extra_kwargs(self): # Check that a projection with non-default values is correctly # converted to a cartopy CRS. longitude_of_projection_origin = 90.0 true_scale_lat = 14.0 ellipsoid = GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.909) merc_cs = Mercator( longitude_of_projection_origin, ellipsoid=ellipsoid, standard_parallel=true_scale_lat) expected = ccrs.Mercator( central_longitude=longitude_of_projection_origin, globe=ccrs.Globe(semimajor_axis=6377563.396, semiminor_axis=6356256.909, ellipse=None), latitude_true_scale=true_scale_lat) res = merc_cs.as_cartopy_crs() self.assertEqual(res, expected)