<?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: ISaveAs GeoTIFF and Georeference information in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158646#M4170</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My 'starting' raster is an elevation GeoTIFF with spatial and georeference properties set.&amp;nbsp; I perform a Hillshade operation (&lt;/SPAN&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisengine/ArcObjects/esriGeoAnalyst/ISurfaceOp_HillShade.htm"&gt;ISurfaceOp.HillShade&lt;/A&gt;&lt;SPAN&gt;) and generate a hillshade raster.&amp;nbsp; I save the generated hillshade raster as a GeoTIFF.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not apply the spatial reference myself; I assumed that if the input raster dataset had these properties set, the output raster dataset would have these properties set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Oct 2010 14:40:53 GMT</pubDate>
    <dc:creator>DavidZwarg</dc:creator>
    <dc:date>2010-10-04T14:40:53Z</dc:date>
    <item>
      <title>ISaveAs GeoTIFF and Georeference information</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158644#M4168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am attempting to run some geoprocessing on a raster, then save the result to a GeoTIFF.&amp;nbsp; I do this in ArcObjects by using ISaveAs on an IGeoDataset:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
IWorkspace rws = null;
try {
&amp;nbsp; rws = (IWorkspace)SetRasterWorkspace(path);
&amp;nbsp; ISaveAs saveMe = (ISaveAs)raster;
&amp;nbsp; saveMe.SaveAs( name, rws, "TIFF" );
}
finally {
&amp;nbsp; COMHelper.SafeRelease(rws);
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HOWEVER, this does not save the Spatial Reference or Georeference information in the GeoTIFF.&amp;nbsp; This is extremely frustrating, because if I copy a raster from GRID to TIF, the georeference gets saved with the GeoTIFF.&amp;nbsp; If I inspect my raster variable from the above, I can find a temporary location of the raster with the following command in my VS-2008 'Immediate Window':&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
((IRaster2)raster).RasterDataset

{System.__ComObject}
&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.__ComObject]: {System.__ComObject}
&amp;nbsp;&amp;nbsp;&amp;nbsp; CompleteName: "C:\\Documents and Settings\\STANDARD\\ASPNET\\Local Settings\\Temp\\raster3"
&amp;nbsp;&amp;nbsp;&amp;nbsp; CompressionType: "Default"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Format: "GRID"
&amp;nbsp;&amp;nbsp;&amp;nbsp; SensorType: "Map Info"

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this is a GRID, with a Spatial Reference and the Georeference information intact.&amp;nbsp; If this is the case, why does it get lost in the ISaveAs operation?&amp;nbsp; Is there any way (in ArcObjects) to COPY this temporary raster to a GeoTIFF, instead of SaveAs, so I can preserve the Spatial Reference and Georeference information?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please advise,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 20:51:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158644#M4168</guid>
      <dc:creator>DavidZwarg</dc:creator>
      <dc:date>2010-09-30T20:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: ISaveAs GeoTIFF and Georeference information</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158645#M4169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi David,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In general, when the input raster has a set spatial reference, then the saveas will honor that. Does you input grid have a spatial reference, you just open it, and then saveas tiff or do you apply the spatial reference (or transformation) yourself? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There are some help topics regarding doing the transformations through code: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_perform_a_geodata_transformation_on_a_raster/0001000002n7000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_perform_a_geodata_transformation_on_a_raster/0001000002n7000000/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, if you're changing the spatial reference, consider doing this on the RasterBandCollection:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RasterBandCollection = RasterDataset.CreateFullRaster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RasterProps = RasterBandCollection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RasterProps.SpatialReference = YourNewSpatialReference&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RasterBandCollection.SaveAs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Robert&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 14:58:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158645#M4169</guid>
      <dc:creator>RobertBerger</dc:creator>
      <dc:date>2010-10-01T14:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: ISaveAs GeoTIFF and Georeference information</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158646#M4170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My 'starting' raster is an elevation GeoTIFF with spatial and georeference properties set.&amp;nbsp; I perform a Hillshade operation (&lt;/SPAN&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisengine/ArcObjects/esriGeoAnalyst/ISurfaceOp_HillShade.htm"&gt;ISurfaceOp.HillShade&lt;/A&gt;&lt;SPAN&gt;) and generate a hillshade raster.&amp;nbsp; I save the generated hillshade raster as a GeoTIFF.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not apply the spatial reference myself; I assumed that if the input raster dataset had these properties set, the output raster dataset would have these properties set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 14:40:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158646#M4170</guid>
      <dc:creator>DavidZwarg</dc:creator>
      <dc:date>2010-10-04T14:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: ISaveAs GeoTIFF and Georeference information</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158647#M4171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi David,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do you move from the GeoDataset to the Raster? Is there a reason you go down to the raster rather than the RasterDataset? I agree with you, the GeoDataset from the hillshade op should continue to have a spatial reference, and saveAs should persist that without issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Robert&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 15:21:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158647#M4171</guid>
      <dc:creator>RobertBerger</dc:creator>
      <dc:date>2010-10-04T15:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: ISaveAs GeoTIFF and Georeference information</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158648#M4172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My procedure is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Set an input RasterWorkspace&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Open a RasterDataset from workspace&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Cast RasterDataset to IGeoDataset&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Perform SurfaceOp.Hillshade&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Set an output RasterWorkspace&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Cast IGeoDataset to ISaveAs2&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Call SaveAs() on the ISaveAs2, with the output workspace, and format of "TIFF"&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll do some testing to see if using the RasterBandCollection.SaveAs is any different.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 12:45:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158648#M4172</guid>
      <dc:creator>DavidZwarg</dc:creator>
      <dc:date>2010-10-05T12:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: ISaveAs GeoTIFF and Georeference information</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158649#M4173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Update:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The georeference information is lost when calling the save methods in the ASPNET worker process (within a web service), but preserved when calling the save methods from the command line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The mystery deepens...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 16:36:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/isaveas-geotiff-and-georeference-information/m-p/158649#M4173</guid>
      <dc:creator>DavidZwarg</dc:creator>
      <dc:date>2010-10-05T16:36:38Z</dc:date>
    </item>
  </channel>
</rss>

