<?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: Export Geotiff with Alpha using IRasterLayerExport3 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-geotiff-with-alpha-using/m-p/1147291#M20428</link>
    <description>&lt;P&gt;In ArcPro the manual export to geotiff with alpha works.&amp;nbsp; In ArcMap 10.8.1 it only outputs a 3 band RGB with no alpha.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I need an automatic process as I have hundreds to do. It is going to another program so GeoTIFF is required. The issue is the automated way using ArcObjects does not seem to add the alpha channel. I have not tried the ArcPro SDK to see if I can do something similar.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I post process using FME to change the 0,0,0 NoData to blank Alpha. It's just an extra processing step I am trying to see if I can do within one of my initial steps rather than.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Feb 2022 22:13:29 GMT</pubDate>
    <dc:creator>Richard_Nairn</dc:creator>
    <dc:date>2022-02-23T22:13:29Z</dc:date>
    <item>
      <title>Export Geotiff with Alpha using IRasterLayerExport3</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-geotiff-with-alpha-using/m-p/1147055#M20426</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to bulk process a number of grids and export out geotiffs. I have been able to use IRasterLayerExport3 to create an RGB geotiff. However they all have black for a background as the tiff only saves with 3 bands, rather than having a four band RGBA.&amp;nbsp; This is my first attempt at using the SDK&lt;/P&gt;&lt;P&gt;I am trying to emulate the ArcPro export raster functionality to save a raster with a color ramp.&lt;/P&gt;&lt;P&gt;The code I currently use looks like this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;IMapDocument pmapDocument = new MapDocument();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;IMap pmap;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;pmapDocument.Open(layerName);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;pmap = pmapDocument.get_Map(0);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;ILayer layer = pmap.Layer[0];&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;IRasterLayer rlayer = layer as IRasterLayer;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;IRasterLayerExport3 r3 = (IRasterLayerExport3)r_export;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;ISaveAs2 save_as = (ISaveAs2)rlayer;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;r3.Force2RGB = true;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;r3.NoData = 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;r3.RasterLayer = rlayer;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;IRasterWorkspace out_Workspace = OpenFileWorkspace(wsName);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;IWorkspace ow = (IWorkspace)out_Workspace;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;r3.Export(ow, outName, "TIFF");&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Am I missing another process that I should be using instead of this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 17:00:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-geotiff-with-alpha-using/m-p/1147055#M20426</guid>
      <dc:creator>Richard_Nairn</dc:creator>
      <dc:date>2022-02-23T17:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export Geotiff with Alpha using IRasterLayerExport3</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-geotiff-with-alpha-using/m-p/1147289#M20427</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/564195"&gt;@Richard_Nairn&lt;/a&gt;&amp;nbsp;I like to trial this in interactive form first. I can get this to work with output to JP2's with the following&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Export the image initially as TIFF.&lt;/LI&gt;&lt;LI&gt;Load the TIFF image your interested in.&lt;/LI&gt;&lt;LI&gt;Go to the symbology tab and Set the Mask values to (0,0,0)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GordonSumerling_0-1645653799012.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34829iB70DD5D752232F48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GordonSumerling_0-1645653799012.png" alt="GordonSumerling_0-1645653799012.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a new area feature class and draw a polygon which has the image extent&lt;/LI&gt;&lt;LI&gt;Right click the TIFF image in the table of contents and select Export Raster&lt;/LI&gt;&lt;OL&gt;&lt;LI&gt;Set the output name to be &amp;lt;name&amp;gt;.jp2&lt;/LI&gt;&lt;LI&gt;Select the clipping Geometry&lt;/LI&gt;&lt;LI&gt;Clipping Type : Outside&lt;/LI&gt;&lt;LI&gt;Use Renderer&lt;/LI&gt;&lt;LI&gt;Force RGB&lt;/LI&gt;&lt;LI&gt;Output format JP2&lt;/LI&gt;&lt;LI&gt;Compression Quality 75&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GordonSumerling_1-1645653824490.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34830i439C4431A4E8932F/image-size/large?v=v2&amp;amp;px=999" role="button" title="GordonSumerling_1-1645653824490.png" alt="GordonSumerling_1-1645653824490.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output image is a 4 Band JP2 image with Alpha band&lt;/P&gt;&lt;P&gt;Hope this helps. some&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 22:04:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-geotiff-with-alpha-using/m-p/1147289#M20427</guid>
      <dc:creator>GordonSumerling</dc:creator>
      <dc:date>2022-02-23T22:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Export Geotiff with Alpha using IRasterLayerExport3</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-geotiff-with-alpha-using/m-p/1147291#M20428</link>
      <description>&lt;P&gt;In ArcPro the manual export to geotiff with alpha works.&amp;nbsp; In ArcMap 10.8.1 it only outputs a 3 band RGB with no alpha.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I need an automatic process as I have hundreds to do. It is going to another program so GeoTIFF is required. The issue is the automated way using ArcObjects does not seem to add the alpha channel. I have not tried the ArcPro SDK to see if I can do something similar.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I post process using FME to change the 0,0,0 NoData to blank Alpha. It's just an extra processing step I am trying to see if I can do within one of my initial steps rather than.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 22:13:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-geotiff-with-alpha-using/m-p/1147291#M20428</guid>
      <dc:creator>Richard_Nairn</dc:creator>
      <dc:date>2022-02-23T22:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Export Geotiff with Alpha using IRasterLayerExport3</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-geotiff-with-alpha-using/m-p/1147301#M20429</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/564195"&gt;@Richard_Nairn&lt;/a&gt;&amp;nbsp;there is a really good dicusion &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/imagery/export-or-convert-raster-datasets.htm" target="_self"&gt;here&lt;/A&gt; on the merits of the Export Raster tool v's the Copy Raster tool. They key is the Force RGB option&lt;/P&gt;&lt;P&gt;" Check the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Force RGB&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;check box to export the output raster as a three-band RGB raster dataset with the current renderer. Additionally, while exporting to formats such as TIFF, JP2, PNG, and MRF that support alpha bands, you can use this option to export the data as a four-band raster dataset with an alpha band to preserve the transparency settings of the original data"&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/copy-raster.htm" target="_self"&gt;copy raster&lt;/A&gt; tool does not have this capability but has the&amp;nbsp;&lt;SPAN&gt;Ignore Background Value option which may be the same.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Gordon&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 22:35:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-geotiff-with-alpha-using/m-p/1147301#M20429</guid>
      <dc:creator>GordonSumerling</dc:creator>
      <dc:date>2022-02-23T22:35:13Z</dc:date>
    </item>
  </channel>
</rss>

