<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: add WMTS-Service as basemap to web map with Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-wmts-service-as-basemap-to-web-map-with-python/m-p/1324292#M8968</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/100922"&gt;@MichaelNüßlein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found documentation on adding WMTS layers here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/samples/publish-ogc-services/" target="_blank"&gt;https://developers.arcgis.com/python/samples/publish-ogc-services/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For instance the following worked for me&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.mapping.ogc import WMTSLayer
from arcgis.mapping import WebMap

gis = GIS("home")

wmts_url = "https://wayback.maptiles.arcgis.com/arcgis/rest/services/world_imagery/wmts"

m = gis.map()
m.add_layer(WMTSLayer(url=wmts_url))
m&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is helpful!&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2023 11:53:05 GMT</pubDate>
    <dc:creator>PeterHodkinson</dc:creator>
    <dc:date>2023-08-31T11:53:05Z</dc:date>
    <item>
      <title>add WMTS-Service as basemap to web map with Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-wmts-service-as-basemap-to-web-map-with-python/m-p/1323868#M8964</link>
      <description>&lt;P&gt;Hi, trying to add a service as basemap to a web map with Python (ArcGIS Pro 3.1) (manually i can do this in Portal 11.1 analogue screenshot&amp;nbsp; below).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MichaelNlein_1-1693399979113.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79458iA79038BC26A20B50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MichaelNlein_1-1693399979113.png" alt="MichaelNlein_1-1693399979113.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately i don't find any example how to do this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks for any help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 12:58:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-wmts-service-as-basemap-to-web-map-with-python/m-p/1323868#M8964</guid>
      <dc:creator>MichaelNüßlein</dc:creator>
      <dc:date>2023-08-30T12:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: add WMTS-Service as basemap to web map with Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-wmts-service-as-basemap-to-web-map-with-python/m-p/1324292#M8968</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/100922"&gt;@MichaelNüßlein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found documentation on adding WMTS layers here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/samples/publish-ogc-services/" target="_blank"&gt;https://developers.arcgis.com/python/samples/publish-ogc-services/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For instance the following worked for me&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.mapping.ogc import WMTSLayer
from arcgis.mapping import WebMap

gis = GIS("home")

wmts_url = "https://wayback.maptiles.arcgis.com/arcgis/rest/services/world_imagery/wmts"

m = gis.map()
m.add_layer(WMTSLayer(url=wmts_url))
m&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is helpful!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 11:53:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-wmts-service-as-basemap-to-web-map-with-python/m-p/1324292#M8968</guid>
      <dc:creator>PeterHodkinson</dc:creator>
      <dc:date>2023-08-31T11:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: add WMTS-Service as basemap to web map with Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-wmts-service-as-basemap-to-web-map-with-python/m-p/1324698#M8972</link>
      <description>&lt;P&gt;It works with Portal 10.9.1 but not with Portal 11.1. Perhaps because the WMTS-Url "&lt;A href="https://wayback.maptiles.arcgis.com/arcgis/rest/services/world_imagery/wmts&amp;quot;" target="_blank"&gt;https://wayback.maptiles.arcgis.com/arcgis/rest/services/world_imagery/wmts"&lt;/A&gt;&amp;nbsp;is not valid&lt;/P&gt;&lt;P&gt;The error message with Portal 11.1 is:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\connection.py", line 174, in _new_conn&lt;BR /&gt;conn = connection.create_connection(&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\util\connection.py", line 72, in create_connection&lt;BR /&gt;for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\socket.py", line 954, in getaddrinfo&lt;BR /&gt;for res in _socket.getaddrinfo(host, port, family, type, proto, flags):&lt;BR /&gt;socket.gaierror: [Errno 11001] getaddrinfo failed&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen&lt;BR /&gt;httplib_response = self._make_request(&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request&lt;BR /&gt;self._validate_conn(conn)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn&lt;BR /&gt;conn.connect()&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\connection.py", line 358, in connect&lt;BR /&gt;self.sock = conn = self._new_conn()&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\connection.py", line 186, in _new_conn&lt;BR /&gt;raise NewConnectionError(&lt;BR /&gt;urllib3.exceptions.NewConnectionError: &amp;lt;urllib3.connection.HTTPSConnection object at 0x0000022DB91FF160&amp;gt;: Failed to establish a new connection: [Errno 11001] getaddrinfo failed&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\requests\adapters.py", line 489, in send&lt;BR /&gt;resp = conn.urlopen(&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\connectionpool.py", line 815, in urlopen&lt;BR /&gt;return self.urlopen(&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\connectionpool.py", line 815, in urlopen&lt;BR /&gt;return self.urlopen(&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen&lt;BR /&gt;retries = retries.increment(&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\urllib3\util\retry.py", line 592, in increment&lt;BR /&gt;raise MaxRetryError(_pool, url, error or ResponseError(cause))&lt;BR /&gt;urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='wayback.maptiles.arcgis.com', port=443): Max retries exceeded with url: /arcgis/rest/services/world_imagery/wmts?service=WMTS&amp;amp;request=GetCapabilities&amp;amp;version=1.0.0&amp;amp;token=ZoYz_-geL4L5e2Pbj6cQkz1sN-2ZMH9zIgLtN5cOHGXBEJx_2eCFVTjrm94O2zoTzAkNGCisuk1LEZ09m16O9-xhZvFi5s9Pc_GaOAmqs4E5xtn_EaKamfVZBgQV1nhNUETn2aZH2HneAZIg_-vMjc1UGKeSkbUpnKTtjDeuw3ruFeJ_GQGdEVvz5PqEBm3Lr0BIQFlVyoYPAnCWzvGr1ekm3p_tYft0_mMtCDTPQVynabc617qqOWW_K-KmxxVY (Caused by NewConnectionError('&amp;lt;urllib3.connection.HTTPSConnection object at 0x0000022DB91FF160&amp;gt;: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 829, in get&lt;BR /&gt;resp = self._session.get(&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\auth\api.py", line 437, in get&lt;BR /&gt;return self._session.get(&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\requests\sessions.py", line 600, in get&lt;BR /&gt;return self.request("GET", url, **kwargs)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\requests\sessions.py", line 587, in request&lt;BR /&gt;resp = self.send(prep, **send_kwargs)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\requests\sessions.py", line 701, in send&lt;BR /&gt;r = adapter.send(request, **kwargs)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\requests\adapters.py", line 565, in send&lt;BR /&gt;raise ConnectionError(e, request=request)&lt;BR /&gt;requests.exceptions.ConnectionError: HTTPSConnectionPool(host='wayback.maptiles.arcgis.com', port=443): Max retries exceeded with url: /arcgis/rest/services/world_imagery/wmts?service=WMTS&amp;amp;request=GetCapabilities&amp;amp;version=1.0.0&amp;amp;token=ZoYz_-geL4L5e2Pbj6cQkz1sN-2ZMH9zIgLtN5cOHGXBEJx_2eCFVTjrm94O2zoTzAkNGCisuk1LEZ09m16O9-xhZvFi5s9Pc_GaOAmqs4E5xtn_EaKamfVZBgQV1nhNUETn2aZH2HneAZIg_-vMjc1UGKeSkbUpnKTtjDeuw3ruFeJ_GQGdEVvz5PqEBm3Lr0BIQFlVyoYPAnCWzvGr1ekm3p_tYft0_mMtCDTPQVynabc617qqOWW_K-KmxxVY (Caused by NewConnectionError('&amp;lt;urllib3.connection.HTTPSConnection object at 0x0000022DB91FF160&amp;gt;: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "\\N5006021\Benutzer\MuellerA345\Eigene Dateien\PortalForArcGIS\Automatisierung\script_datenbereitstellung\publishgeodata.py", line 667, in &amp;lt;module&amp;gt;&lt;BR /&gt;runForServer(server_url, p)&lt;BR /&gt;File "\\N5006021\Benutzer\MuellerA345\Eigene Dateien\PortalForArcGIS\Automatisierung\script_datenbereitstellung\publishgeodata.py", line 521, in runForServer&lt;BR /&gt;publishBasemaps(gis, item_category_json, license_text)&lt;BR /&gt;File "\\N5006021\Benutzer\MuellerA345\Eigene Dateien\PortalForArcGIS\Automatisierung\script_datenbereitstellung\publishgeodata.py", line 343, in publishBasemaps&lt;BR /&gt;m.add_layer(WMTSLayer(url=wmts_url))&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\widgets\_mapview\_mapview.py", line 1505, in add_layer&lt;BR /&gt;self._add_layer_to_widget(item, options)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\widgets\_mapview\_mapview.py", line 1597, in _add_layer_to_widget&lt;BR /&gt;self._add_layer_to_webmap(item, options)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\widgets\_mapview\_mapview.py", line 1510, in _add_layer_to_webmap&lt;BR /&gt;self.webmap.add_layer(item, webmap_options)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\mapping\_types.py", line 515, in add_layer&lt;BR /&gt;new_layer = self._create_layer_definition(layer, options)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\mapping\_types.py", line 924, in _create_layer_definition&lt;BR /&gt;new_layer = {**new_layer, **layer._operational_layer_json}&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\mapping\ogc\wmts.py", line 275, in _operational_layer_json&lt;BR /&gt;return self.__text__&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\mapping\ogc\wmts.py", line 204, in __text__&lt;BR /&gt;if isinstance(self.properties.Capabilities.Contents.Layer, (list, tuple)):&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\mapping\ogc\wmts.py", line 87, in properties&lt;BR /&gt;text = self._con.get(url, {}, try_json=False, add_token=False)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 843, in get&lt;BR /&gt;raise requests.exceptions.ConnectionError(&lt;BR /&gt;requests.exceptions.ConnectionError: A connection error has occurred: HTTPSConnectionPool(host='wayback.maptiles.arcgis.com', port=443): Max retries exceeded with url: /arcgis/rest/services/world_imagery/wmts?service=WMTS&amp;amp;request=GetCapabilities&amp;amp;version=1.0.0&amp;amp;token=ZoYz_-geL4L5e2Pbj6cQkz1sN-2ZMH9zIgLtN5cOHGXBEJx_2eCFVTjrm94O2zoTzAkNGCisuk1LEZ09m16O9-xhZvFi5s9Pc_GaOAmqs4E5xtn_EaKamfVZBgQV1nhNUETn2aZH2HneAZIg_-vMjc1UGKeSkbUpnKTtjDeuw3ruFeJ_GQGdEVvz5PqEBm3Lr0BIQFlVyoYPAnCWzvGr1ekm3p_tYft0_mMtCDTPQVynabc617qqOWW_K-KmxxVY (Caused by NewConnectionError('&amp;lt;urllib3.connection.HTTPSConnection object at 0x0000022DB91FF160&amp;gt;: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 12:58:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-wmts-service-as-basemap-to-web-map-with-python/m-p/1324698#M8972</guid>
      <dc:creator>MichaelNüßlein</dc:creator>
      <dc:date>2023-09-01T12:58:23Z</dc:date>
    </item>
  </channel>
</rss>

