<?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 Reloading a local raster layer from disk in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/reloading-a-local-raster-layer-from-disk/m-p/181834#M4725</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am creating a raster layer in ArcMap 10.1 and displaying it in the map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; CComPtr&amp;lt;IRasterLayer&amp;gt; iRasterLayer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; iRasterLayer.CoCreateInstance(CLSID_RasterLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; iRasterLayer-&amp;gt;CreateFromFilePath(rasterFile);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_pMap-&amp;gt;AddLayer(iRasterLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The file on disk that is at the rasterFile location is later changed by some other software and I want the map to reflect that change.&amp;nbsp; I have tried many different approaches with no success.&amp;nbsp; For example, I tried the obvious which was to remove the raster layer from the map, then create a new raster layer as in the code above.&amp;nbsp; Even in that case, it still displays the OLD image, not the updated one.&amp;nbsp; I am assuming there is some cacheing going on that is based strictly on the filename.&amp;nbsp; My only recourse has been to restart ArcMap which of course is not an acceptable workaround.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have any advice?&amp;nbsp; My preference is to do something at the original RasterLayer object level (e.g. telling it to reload/clear cache, etc.), but anything short of restarting ArcMap would be an improvement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, this issue is not specific to ArcObjects.&amp;nbsp; I can reproduce the same behavior by adding the raster file interactively via the ArcMap GUI, removing the layer, updating the file, then adding the file via the GUI again.&amp;nbsp; But, I am hoping there is something I can call in ArcObjects to address this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kyle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jul 2013 17:41:34 GMT</pubDate>
    <dc:creator>KyleEllison</dc:creator>
    <dc:date>2013-07-23T17:41:34Z</dc:date>
    <item>
      <title>Reloading a local raster layer from disk</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/reloading-a-local-raster-layer-from-disk/m-p/181834#M4725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am creating a raster layer in ArcMap 10.1 and displaying it in the map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; CComPtr&amp;lt;IRasterLayer&amp;gt; iRasterLayer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; iRasterLayer.CoCreateInstance(CLSID_RasterLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; iRasterLayer-&amp;gt;CreateFromFilePath(rasterFile);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_pMap-&amp;gt;AddLayer(iRasterLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The file on disk that is at the rasterFile location is later changed by some other software and I want the map to reflect that change.&amp;nbsp; I have tried many different approaches with no success.&amp;nbsp; For example, I tried the obvious which was to remove the raster layer from the map, then create a new raster layer as in the code above.&amp;nbsp; Even in that case, it still displays the OLD image, not the updated one.&amp;nbsp; I am assuming there is some cacheing going on that is based strictly on the filename.&amp;nbsp; My only recourse has been to restart ArcMap which of course is not an acceptable workaround.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have any advice?&amp;nbsp; My preference is to do something at the original RasterLayer object level (e.g. telling it to reload/clear cache, etc.), but anything short of restarting ArcMap would be an improvement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, this issue is not specific to ArcObjects.&amp;nbsp; I can reproduce the same behavior by adding the raster file interactively via the ArcMap GUI, removing the layer, updating the file, then adding the file via the GUI again.&amp;nbsp; But, I am hoping there is something I can call in ArcObjects to address this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kyle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 17:41:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/reloading-a-local-raster-layer-from-disk/m-p/181834#M4725</guid>
      <dc:creator>KyleEllison</dc:creator>
      <dc:date>2013-07-23T17:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Reloading a local raster layer from disk</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/reloading-a-local-raster-layer-from-disk/m-p/181835#M4726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having the same problem, have you ever found a fix or workaround for your issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/reloading-a-local-raster-layer-from-disk/m-p/181835#M4726</guid>
      <dc:creator>DavidEscalera1</dc:creator>
      <dc:date>2015-10-08T14:44:21Z</dc:date>
    </item>
  </channel>
</rss>

