<?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: Updating hosted image layers on ArcGIS Online in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-hosted-image-layers-on-arcgis-online/m-p/1555474#M10848</link>
    <description>&lt;P&gt;Purva from ESRI help pointed me to the following doc which helped:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/latest/guide/managing-your-content/#:~:text=directory%5CIMAGE_NAME.png%27-,Deleting%20content,-You%20can%20delete" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/latest/guide/managing-your-content/#:~:text=directory%5CIMAGE_NAME.png%27-,Deleting%20content,-You%20can%20delete&lt;/A&gt;&lt;/P&gt;&lt;P&gt;After logging in using the API the following works for deleting a tiled image&lt;/P&gt;&lt;LI-CODE lang="c"&gt;search = gis.content.search('NAME_OF_TILE_IMAGE', max_items=-1)
for item in search:
    if item.title == 'NAME_OF_TILE_IMAGE':
        itemID = item.id

item_for_deletion = gis.content.get(itemID)
item_for_deletion.protect(enable = False)
item_for_deletion.delete(permanent=True)&lt;/LI-CODE&gt;&lt;P&gt;To load a new image the following works&lt;/P&gt;&lt;LI-CODE lang="c"&gt;input_raster_path = r"/PATH/TO/IMAGE/NAME_OF_TILES_IMAGE.tif"
single_image_layer = copy_raster(input_raster=input_raster_path,output_name="NAME_OF_TILES_IMAGE",gis=gis)
single_image_layer.protect(enable = True)&lt;/LI-CODE&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2024 16:26:39 GMT</pubDate>
    <dc:creator>jmpmcmanus</dc:creator>
    <dc:date>2024-11-05T16:26:39Z</dc:date>
    <item>
      <title>Updating hosted image layers on ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-hosted-image-layers-on-arcgis-online/m-p/1553481#M10812</link>
      <description>&lt;P&gt;I have an ArcGIS Online dashboard map app, that includes an image layer. The image is of a hurricane storm surge and I would like to update that image when new data is produced, in the same way images are updated in ArcGIS live atlas of the world. I would like to do this using ArcGIS API for Python (AAFP) if possible.&lt;/P&gt;&lt;P&gt;Is there a good tutorial or documentation on how to do this?&lt;/P&gt;&lt;P&gt;I understand a tiled Image Layers can not be update, but must be deleted and then replaced. I've attempted to do this but found that I cannot add a new image with the same name because the image service still exists.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RuntimeError&lt;/STRONG&gt;&lt;SPAN&gt;: An Image Service by this name already exists: output_test_imagery_layer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have not found a way to delete the image service on ArcGIS Online. I did find documentation on how to do it in ArcGIS Enterprise, but those methods were not accessible in ArcGIS Online.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, I have not found a way to delete a tile image layer using AAFP. The delete_image method I did find required a image collection, as in the case of a dynamic image layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I looked into using Dynamic Image Layer, but found that type of image could only be made accessible at the organization level, not the public level. The&amp;nbsp;dashboard map app is accessible by the public so that is a problem, unless there is a work around.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 19:48:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-hosted-image-layers-on-arcgis-online/m-p/1553481#M10812</guid>
      <dc:creator>jmpmcmanus</dc:creator>
      <dc:date>2024-10-29T19:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Updating hosted image layers on ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-hosted-image-layers-on-arcgis-online/m-p/1555474#M10848</link>
      <description>&lt;P&gt;Purva from ESRI help pointed me to the following doc which helped:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/latest/guide/managing-your-content/#:~:text=directory%5CIMAGE_NAME.png%27-,Deleting%20content,-You%20can%20delete" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/latest/guide/managing-your-content/#:~:text=directory%5CIMAGE_NAME.png%27-,Deleting%20content,-You%20can%20delete&lt;/A&gt;&lt;/P&gt;&lt;P&gt;After logging in using the API the following works for deleting a tiled image&lt;/P&gt;&lt;LI-CODE lang="c"&gt;search = gis.content.search('NAME_OF_TILE_IMAGE', max_items=-1)
for item in search:
    if item.title == 'NAME_OF_TILE_IMAGE':
        itemID = item.id

item_for_deletion = gis.content.get(itemID)
item_for_deletion.protect(enable = False)
item_for_deletion.delete(permanent=True)&lt;/LI-CODE&gt;&lt;P&gt;To load a new image the following works&lt;/P&gt;&lt;LI-CODE lang="c"&gt;input_raster_path = r"/PATH/TO/IMAGE/NAME_OF_TILES_IMAGE.tif"
single_image_layer = copy_raster(input_raster=input_raster_path,output_name="NAME_OF_TILES_IMAGE",gis=gis)
single_image_layer.protect(enable = True)&lt;/LI-CODE&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 16:26:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-hosted-image-layers-on-arcgis-online/m-p/1555474#M10848</guid>
      <dc:creator>jmpmcmanus</dc:creator>
      <dc:date>2024-11-05T16:26:39Z</dc:date>
    </item>
  </channel>
</rss>

