|
| 1 | +Version 0.21 (September 9, 2022) |
| 2 | +================================ |
| 3 | + |
| 4 | +Cartopy v0.21 is not compatible with Shapely 2.0, so this release |
| 5 | +has an upper pin on Shapely to avoid installing newer versions. |
| 6 | + |
| 7 | +For a full list of included Pull Requests and closed Issues, please see the |
| 8 | +`0.21 milestone <https://github.com/SciTools/cartopy/milestone/30>`_. |
| 9 | + |
| 10 | +Features |
| 11 | +-------- |
| 12 | + |
| 13 | +* The requirement to install with a local PROJ installation has been removed. |
| 14 | + The previous C PROJ library calls have been replaced by pyproj. |
| 15 | + (:pull:`2069`) |
| 16 | + |
| 17 | +* Many test improvements, including moving to pytest-mpl for image comparisons |
| 18 | + and parametrizing many tests where possible. |
| 19 | + (:pull:`1887`, :pull:`1891`, :pull:`1900`) |
| 20 | + |
| 21 | +* The UTF8 degree symbol is now used for latitude and longitude labels. |
| 22 | + (:pull:`1885`) |
| 23 | + |
| 24 | +* Clément fixed an issue that would ignore the alpha channel when |
| 25 | + reprojecting RGBA images. (:pull:`1906`) |
| 26 | + |
| 27 | + .. plot:: |
| 28 | + :width: 400pt |
| 29 | + |
| 30 | + import matplotlib.pyplot as plt |
| 31 | + import numpy as np |
| 32 | + import cartopy.crs as ccrs |
| 33 | + |
| 34 | + dy, dx = (4, 10) |
| 35 | + rgba = np.linspace(0, 255*31, dx*dy*4, dtype=np.uint8).reshape((dy, dx, 4)) |
| 36 | + rgba[:, :, 3] = np.linspace(0, 255, dx, dtype=np.uint8).reshape(1, dx) |
| 37 | + |
| 38 | + fig = plt.figure(figsize=(10, 5)) |
| 39 | + ax = plt.axes(projection=ccrs.Orthographic(central_latitude=45)) |
| 40 | + ax.imshow(rgba, transform=ccrs.PlateCarree()) |
| 41 | + |
| 42 | + plt.show() |
| 43 | + |
| 44 | +* Filled features no longer set the edgecolor by default. The edgecolor can |
| 45 | + still be explicitly set when adding the feature |
| 46 | + ``ax.add_feature(LAND, edgecolor='k')``. (:pull:`1933`) |
| 47 | + |
| 48 | +* The **approx** keyword to TransverseMercator, OSGB, and OSNI projections |
| 49 | + now defaults to False. (:pull:`1957`) |
| 50 | + |
| 51 | +* ``geoaxes.add_geometries()`` now accepts both a list of geometries and a |
| 52 | + single geometry. (:pull:`1999`) |
| 53 | + |
| 54 | +* Better handling of non-ndarray inputs like ``xarray.DataArray``. |
| 55 | + (:pull:`2050`) |
| 56 | + |
| 57 | +* Alan Brammer added the ability to pass CRS's for the text and xy coordinates |
| 58 | + used in ``ax.annotate()``. (:pull:`2065`) |
| 59 | + |
| 60 | + .. plot:: |
| 61 | + :width: 400pt |
| 62 | + |
| 63 | + import matplotlib.pyplot as plt |
| 64 | + import numpy as np |
| 65 | + import cartopy.crs as ccrs |
| 66 | + |
| 67 | + map_projection = ccrs.InterruptedGoodeHomolosine() |
| 68 | + |
| 69 | + fig = plt.figure(figsize=(10, 5)) |
| 70 | + ax = fig.add_subplot(1, 1, 1, projection=map_projection) |
| 71 | + ax.set_global() |
| 72 | + ax.coastlines() |
| 73 | + arrowprops = {'facecolor': 'red', |
| 74 | + 'arrowstyle': "-|>", |
| 75 | + 'connectionstyle': "arc3,rad=-0.2", |
| 76 | + } |
| 77 | + platecarree = ccrs.PlateCarree() |
| 78 | + mpltransform = platecarree._as_mpl_transform(ax) |
| 79 | +
|
| 80 | + ax.annotate('mpl xycoords', (-45, 43), xycoords=mpltransform, |
| 81 | + size=5) |
| 82 | + |
| 83 | + # Add annotation with xycoords as projection |
| 84 | + ax.annotate('crs xycoords', (-75, 13), xycoords=platecarree, |
| 85 | + size=5) |
| 86 | + |
| 87 | + # set up coordinates in map projection space |
| 88 | + map_coords = map_projection.transform_point(-175, -35, platecarree) |
| 89 | + # Dont specifiy any args, default xycoords='data', transform=map projection |
| 90 | + ax.annotate('default crs', map_coords, size=5) |
| 91 | + |
| 92 | + # data in map projection using default transform, with |
| 93 | + # text positioned in platecaree transform |
| 94 | + ax.annotate('mixed crs transforms', map_coords, xycoords='data', |
| 95 | + xytext=(-175, -55), |
| 96 | + textcoords=platecarree, |
| 97 | + size=5, |
| 98 | + arrowprops=arrowprops, |
| 99 | + ) |
| 100 | + |
| 101 | + # Add annotation with point and text via transform |
| 102 | + ax.annotate('crs transform', (-75, -20), xytext=(0, -55), |
| 103 | + transform=platecarree, |
| 104 | + arrowprops=arrowprops, |
| 105 | + ) |
| 106 | + |
| 107 | + # Add annotation with point via transform and text non transformed |
| 108 | + ax.annotate('offset textcoords', (-149.8, 61.22), transform=platecarree, |
| 109 | + xytext=(-35, 10), textcoords='offset points', |
| 110 | + size=5, |
| 111 | + ha='right', |
| 112 | + arrowprops=arrowprops, |
| 113 | + ) |
| 114 | + |
| 115 | + plt.show() |
| 116 | + |
| 117 | +Deprecations |
| 118 | +------------ |
| 119 | + |
| 120 | +* Passing **map_projection** as a keyword when manually creating a GeoAxes |
| 121 | + object is deprecated, use **projection** instead. |
| 122 | + |
| 123 | +Removals |
| 124 | +-------- |
| 125 | + |
| 126 | +The following functions and classes have been removed after being deprecated |
| 127 | +multiple versions prior. See the previous What's New notes for replacements. |
| 128 | + |
| 129 | +* ``geoaxes.outline_patch()`` |
| 130 | +* ``geoaxes.background_patch()`` |
| 131 | +* ``geoaxes.natural_earth_shp()`` |
| 132 | +* The argument ``secant_latitudes`` to the LambertConformal projection. |
| 133 | +* ``img_tiles.StamenTerrain`` |
| 134 | +* ``srtm.SRTM3_retrieve``, ``srtm.srtm``, ``srtm.srtm_composite``, and |
| 135 | + ``srtm.fill_gaps`` |
| 136 | +* ``clip_path.clip_path`` |
0 commit comments