<?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 Rebuild a raster's pyramid? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/rebuild-a-raster-s-pyramid/m-p/93792#M2496</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've been having a problem getting the pyramid layers of a raster that has been modified to rebuild.&amp;nbsp; The raster has had some pixels that have been changed, but I can't get the pyramids to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following piece of code throws an exception along the lines of "Failed to build pyramid" when I hit the DeletePyramid command:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Convert the ILayer to an IRasterLayer. Note that ApplicationState.CurrentExtractionRasterLayer is an ILayer in my application. */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IRasterLayer irl = ApplicationState.CurrentExtractionRasterLayer as IRasterLayer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Rebuild the pyramid layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IRasterPyramid3 irp3 = (irl.Raster as IRaster2).RasterDataset as IRasterPyramid3;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;irp3.DeletePyramid(); // Exception thrown here!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I instead call &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;irp3.Create();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in place of DeletePyramid(), no exception is thrown, but only the bottom layer of the pyramid is correct!&amp;nbsp; Any ideas on where I've gone wrong?&amp;nbsp; I thought that it could be the case that Arc is somehow not allowing itself to overwrite the .ovr file it created when the layer is loaded, but I really have no idea.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Patrick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Nov 2011 16:54:59 GMT</pubDate>
    <dc:creator>PatrickYoung1</dc:creator>
    <dc:date>2011-11-17T16:54:59Z</dc:date>
    <item>
      <title>Rebuild a raster's pyramid?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/rebuild-a-raster-s-pyramid/m-p/93792#M2496</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've been having a problem getting the pyramid layers of a raster that has been modified to rebuild.&amp;nbsp; The raster has had some pixels that have been changed, but I can't get the pyramids to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following piece of code throws an exception along the lines of "Failed to build pyramid" when I hit the DeletePyramid command:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Convert the ILayer to an IRasterLayer. Note that ApplicationState.CurrentExtractionRasterLayer is an ILayer in my application. */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IRasterLayer irl = ApplicationState.CurrentExtractionRasterLayer as IRasterLayer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Rebuild the pyramid layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IRasterPyramid3 irp3 = (irl.Raster as IRaster2).RasterDataset as IRasterPyramid3;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;irp3.DeletePyramid(); // Exception thrown here!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I instead call &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;irp3.Create();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in place of DeletePyramid(), no exception is thrown, but only the bottom layer of the pyramid is correct!&amp;nbsp; Any ideas on where I've gone wrong?&amp;nbsp; I thought that it could be the case that Arc is somehow not allowing itself to overwrite the .ovr file it created when the layer is loaded, but I really have no idea.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Patrick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 16:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/rebuild-a-raster-s-pyramid/m-p/93792#M2496</guid>
      <dc:creator>PatrickYoung1</dc:creator>
      <dc:date>2011-11-17T16:54:59Z</dc:date>
    </item>
  </channel>
</rss>

