xoa.plot.add_layer

Contents

xoa.plot.add_layer#

xoa.plot.add_layer(ax, name=None, alpha=None, zorder=None, attribution=None, fallback=True, **kwargs)[source]#

Add a background layer from a web map service to a cartopy axes

The layers are defined in the layers section of the xoa config, like in the following example:

[layers]
    [[mylayer]]
    kind = wms
    url = https://my.server/wms?
    layer = my_layer_name
    attribution = My credits
Parameters:
  • ax (cartopy.mpl.geoaxes.GeoAxes)

  • name (None, str) – Layer name, which defaults to the plot.layer option

  • alpha (None, float) – Opacity, which defaults to the plot.layer_alpha option

  • zorder (None, float) – Drawing order, which defaults to the plot.layer_zorder option

  • attribution (None, bool) – Draw the attribution of the layer, if any, which defaults to the plot.layer_attribution option

  • fallback (bool) – Add the land with add_land() and warn when the service fails instead of raising the error

  • kwargs – Extra parameters are passed to cartopy.mpl.geoaxes.GeoAxes.add_wms() or cartopy.mpl.geoaxes.GeoAxes.add_wmts()

Returns:

matplotlib.artist.Artist

See also

get_layer