Interactive WMTS (Web Map Tile Service)ΒΆ

This example demonstrates the interactive pan and zoom capability supported by an OGC web services Web Map Tile Service (WMTS) aware axes.

The example WMTS layer is a single composite of data sampled over nine days in April 2012 and thirteen days in October 2012 showing the Earth at night. It does not vary over time.

The imagery was collected by the Suomi National Polar-orbiting Partnership (Suomi NPP) weather satellite operated by the United States National Oceanic and Atmospheric Administration (NOAA).

Traceback (most recent call last):
  File "/root/project/examples/web_services/", line 35, in <module>
  File "/root/project/examples/web_services/", line 27, in main
    ax.add_wmts(url, layer)
  File "/root/project/lib/cartopy/mpl/", line 2140, in add_wmts
  File "/root/project/lib/cartopy/io/", line 356, in __init__
    wmts = owslib.wmts.WebMapTileService(wmts)
  File "/opt/conda/envs/test-environment/lib/python3.7/site-packages/owslib/", line 189, in __init__
  File "/opt/conda/envs/test-environment/lib/python3.7/site-packages/owslib/", line 240, in _buildMetadata
    gather_layers(caps, None)
  File "/opt/conda/envs/test-environment/lib/python3.7/site-packages/owslib/", line 237, in gather_layers
    'already exists' %
KeyError: 'Content metadata for layer "AMSUA_NOAA15_Brightness_Temp_Channel_10" already exists'

import matplotlib.pyplot as plt
import as ccrs

def main():
    url = ''
    layer = 'VIIRS_CityLights_2012'

    fig = plt.figure()
    ax = fig.add_subplot(1, 1, 1, projection=ccrs.PlateCarree())
    ax.add_wmts(url, layer)
    ax.set_extent([-15, 25, 35, 60], crs=ccrs.PlateCarree())

    ax.set_title('Suomi NPP Earth at night April/October 2012')

if __name__ == '__main__':

Total running time of the script: ( 0 minutes 0.842 seconds)

Gallery generated by Sphinx-Gallery