<?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: Adding MapService Raster Layer from ArcGIS REST Services directory to a ArcMap MXD using ArcPy in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1129427#M32145</link>
    <description>&lt;P&gt;It looks like this is difficult , if not impossible to do in ArcMap.&lt;/P&gt;&lt;P&gt;&lt;A title="GIS StackExchange" href="https://gis.stackexchange.com/questions/346592/adding-data-using-python-from-arcgis-online-arcgis-rest-services-directory-to-a" target="_blank" rel="noopener"&gt;Adding data using Python from ArcGIS Online/ArcGIS REST Services directory to a ArcMap MXD&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcGIS Pro is better suited for this type of operation.&lt;/P&gt;&lt;P&gt;&lt;A title="addDataFromPath" href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm#:~:text=and%20addLayer%20methods.-,addDataFromPath%20(data_path),-Parameter" target="_blank" rel="noopener"&gt;addDataFromPath&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Dec 2021 15:04:37 GMT</pubDate>
    <dc:creator>TonyContreras_Frisco_TX</dc:creator>
    <dc:date>2021-12-29T15:04:37Z</dc:date>
    <item>
      <title>Adding MapService Raster Layer from ArcGIS REST Services directory to a ArcMap MXD using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1127138#M32034</link>
      <description>&lt;P&gt;Adding MapService raster layer using ArcPy from ArcGIS REST Services directory to a ArcMap MXD&lt;/P&gt;&lt;P&gt;I have map services published in to a specific folder on to an ArcGIS Server site. Each map service publishes raster layers.&lt;BR /&gt;Tipically the url of the rest directory of a raster layer is:&lt;BR /&gt;https://&amp;lt;my host&amp;gt;/server/rest/services/&amp;lt;folder&amp;gt;/&amp;lt;service name&amp;gt;/MapServer/&amp;lt;id&amp;gt;&lt;/P&gt;&lt;P&gt;Unsing ArcPy I would like to add&amp;nbsp; the raster layer to a MXD using its rest directory url.&lt;BR /&gt;I have tried the following code embedded in the "execute" section of a python arctoolbox:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy.mapping
IMXD = arcpy.mapping.MapDocument("CURRENT")
DF_layer = arcpy.mapping.ListDataFrames(IMXD, "Layers")[0]
url_ras_layer = r"https://&amp;lt;my host&amp;gt;/server/rest/services/&amp;lt;folder&amp;gt;/&amp;lt;service name&amp;gt;/MapServer/&amp;lt;id&amp;gt;"
arcpy.mapping.AddLayer(DF, arcpy.mapping.Layer(url_ras_layer))&lt;/LI-CODE&gt;&lt;P&gt;but I got the error message:&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#FF0000"&gt;ValueError: Object: CreateObject Layer invalid data source&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Furthermore I guess that an account must provided in order to establish the right access to the datastore.&lt;/P&gt;&lt;P&gt;Hoping that is possible to perform the add operation via ArcPy, how can I do it ?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 14:12:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1127138#M32034</guid>
      <dc:creator>GiuseppeGentili</dc:creator>
      <dc:date>2021-12-17T14:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding MapService Raster Layer from ArcGIS REST Services directory to a ArcMap MXD using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1129427#M32145</link>
      <description>&lt;P&gt;It looks like this is difficult , if not impossible to do in ArcMap.&lt;/P&gt;&lt;P&gt;&lt;A title="GIS StackExchange" href="https://gis.stackexchange.com/questions/346592/adding-data-using-python-from-arcgis-online-arcgis-rest-services-directory-to-a" target="_blank" rel="noopener"&gt;Adding data using Python from ArcGIS Online/ArcGIS REST Services directory to a ArcMap MXD&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcGIS Pro is better suited for this type of operation.&lt;/P&gt;&lt;P&gt;&lt;A title="addDataFromPath" href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm#:~:text=and%20addLayer%20methods.-,addDataFromPath%20(data_path),-Parameter" target="_blank" rel="noopener"&gt;addDataFromPath&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 15:04:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1129427#M32145</guid>
      <dc:creator>TonyContreras_Frisco_TX</dc:creator>
      <dc:date>2021-12-29T15:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding MapService Raster Layer from ArcGIS REST Services directory to a ArcMap MXD using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1129597#M32151</link>
      <description>&lt;P&gt;It is not supported in ArcMap.&lt;/P&gt;&lt;P&gt;ArcGIS Pro 2.7 or above allows you to do that. Here is a sample code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject("CURRENT")
m = p.listMaps()[0]
m.addDataFromPath("https://rmgsc.cr.usgs.gov/arcgis/rest/services/contUS/MapServer/0")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please note, it still gets added as an "ArcGIS Map Service" layer with one sublayer points to the raster layer off the map service.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 01:12:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1129597#M32151</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2021-12-30T01:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding MapService Raster Layer from ArcGIS REST Services directory to a ArcMap MXD using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1130018#M32161</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Well, many thanks for your clarification and sample. &lt;/SPAN&gt;&lt;SPAN&gt;My hope was to find a solution also for the ArcMap environment ...&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 08:56:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1130018#M32161</guid>
      <dc:creator>GiuseppeGentili</dc:creator>
      <dc:date>2022-01-03T08:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding MapService Raster Layer from ArcGIS REST Services directory to a ArcMap MXD using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1130440#M32174</link>
      <description>&lt;P&gt;since the discussion is about ArcMap, I'd like to point out to this post&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/arcmap-esri-plan" target="_blank"&gt;https://support.esri.com/en/arcmap-esri-plan&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 17:58:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/adding-mapservice-raster-layer-from-arcgis-rest/m-p/1130440#M32174</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2022-01-04T17:58:31Z</dc:date>
    </item>
  </channel>
</rss>

