.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/web_services/wms.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_wms.py: Interactive WMS (Web Map Service) --------------------------------- This example demonstrates the interactive pan and zoom capability supported by an OGC web services Web Map Service (WMS) aware axes. .. GENERATED FROM PYTHON SOURCE LINES 9-27 .. rst-class:: sphx-glr-script-out .. code-block:: pytb Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/cartopy/checkouts/v0.25.0.post2/examples/web_services/wms.py", line 26, in main() ~~~~^^ File "/home/docs/checkouts/readthedocs.org/user_builds/cartopy/checkouts/v0.25.0.post2/examples/web_services/wms.py", line 19, in main ax.add_wms(wms='http://vmap0.tiles.osgeo.org/wms/vmap0', ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ layers=['basic']) ^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/cartopy/conda/v0.25.0.post2/lib/python3.13/site-packages/cartopy/mpl/geoaxes.py", line 2280, in add_wms wms = WMSRasterSource(wms, layers, getmap_extra_kwargs=wms_kwargs) File "/home/docs/checkouts/readthedocs.org/user_builds/cartopy/conda/v0.25.0.post2/lib/python3.13/site-packages/cartopy/io/ogc_clients.py", line 228, in __init__ service = WebMapService(service) File "/home/docs/checkouts/readthedocs.org/user_builds/cartopy/conda/v0.25.0.post2/lib/python3.13/site-packages/owslib/wms.py", line 50, in WebMapService return wms111.WebMapService_1_1_1( ~~~~~~~~~~~~~~~~~~~~~~~~~~^ clean_url, version=version, xml=xml, parse_remote_metadata=parse_remote_metadata, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timeout=timeout, headers=headers, auth=auth) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/cartopy/conda/v0.25.0.post2/lib/python3.13/site-packages/owslib/map/wms111.py", line 75, in __init__ self._capabilities = reader.read(self.url, timeout=self.timeout) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/cartopy/conda/v0.25.0.post2/lib/python3.13/site-packages/owslib/map/common.py", line 65, in read u = openURL(spliturl[0], spliturl[1], method='Get', timeout=timeout, headers=self.headers, auth=self.auth) File "/home/docs/checkouts/readthedocs.org/user_builds/cartopy/conda/v0.25.0.post2/lib/python3.13/site-packages/owslib/util.py", line 213, in openURL req.raise_for_status() ~~~~~~~~~~~~~~~~~~~~^^ File "/home/docs/checkouts/readthedocs.org/user_builds/cartopy/conda/v0.25.0.post2/lib/python3.13/site-packages/requests/models.py", line 1026, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://vmap0.tiles.osgeo.org/wms/vmap0?service=WMS&request=GetCapabilities&version=1.1.1 | .. code-block:: Python import matplotlib.pyplot as plt import cartopy.crs as ccrs def main(): fig = plt.figure(figsize=(10, 5)) ax = fig.add_subplot(1, 1, 1, projection=ccrs.InterruptedGoodeHomolosine()) ax.coastlines() ax.add_wms(wms='http://vmap0.tiles.osgeo.org/wms/vmap0', layers=['basic']) plt.show() if __name__ == '__main__': main() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.367 seconds) .. _sphx_glr_download_gallery_web_services_wms.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: wms.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: wms.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: wms.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_