.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/web_services/wmts.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_web_services_wmts.py: 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). .. GENERATED FROM PYTHON SOURCE LINES 17-37 .. rst-class:: sphx-glr-script-out .. code-block:: pytb Traceback (most recent call last): File "/home/circleci/project/examples/web_services/wmts.py", line 36, in main() File "/home/circleci/project/examples/web_services/wmts.py", line 28, in main ax.add_wmts(url, layer) File "/home/circleci/project/lib/cartopy/mpl/geoaxes.py", line 2257, in add_wmts wmts = WMTSRasterSource(wmts, layer_name, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/circleci/project/lib/cartopy/io/ogc_clients.py", line 379, in __init__ wmts = owslib.wmts.WebMapTileService(wmts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/circleci/.local/lib/python3.11/site-packages/owslib/wmts.py", line 197, in __init__ self._buildMetadata(parse_remote_metadata) File "/home/circleci/.local/lib/python3.11/site-packages/owslib/wmts.py", line 248, in _buildMetadata gather_layers(caps, None) File "/home/circleci/.local/lib/python3.11/site-packages/owslib/wmts.py", line 239, in gather_layers cm = ContentMetadata( ^^^^^^^^^^^^^^^^ File "/home/circleci/.local/lib/python3.11/site-packages/owslib/wmts.py", line 819, in __init__ raise ValueError( ValueError: list of values can not be empty | .. code-block:: Python import matplotlib.pyplot as plt import cartopy.crs as ccrs def main(): url = 'https://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi' 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') plt.show() if __name__ == '__main__': main() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.316 seconds) .. _sphx_glr_download_gallery_web_services_wmts.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: wmts.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: wmts.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_