<?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: Reprojection while loading Rasters in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/reprojection-while-loading-rasters/m-p/598874#M16083</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you see the code snippet online: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_project_a_raster_with_a_datum_transformation/0001000003t8000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_project_a_raster_with_a_datum_transformation/0001000003t8000000/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;It talks about reprojecting a raster. The saveas call in the end just needs to go to your geodatabase rather than file system. I think that should do it.&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, 10 Sep 2010 14:26:48 GMT</pubDate>
    <dc:creator>RobertBerger</dc:creator>
    <dc:date>2010-09-10T14:26:48Z</dc:date>
    <item>
      <title>Reprojection while loading Rasters</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/reprojection-while-loading-rasters/m-p/598873#M16082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm loading rasters into a file geodatabase in Engine code.&amp;nbsp; Some of them need reprojecting so I'm trying the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
// I have an IRaster pointed to by pRaster and a required ISpatialReference pointed to by pSpatialRef

VARIANT vMissing;
vMissing.vt = VT_ERROR;
vMissing.scode = DISP_E_PARAMNOTFOUND;

// Create a RasterTransformionOp to do the re-projection
CComPtr&amp;lt;ITransformationOp&amp;gt; pTransform;
hr = pTransform.CoCreateInstance(CLSID_RasterTransformationOp);

// get the IGeoDataset of the original Raster
CComPtr&amp;lt;IGeoDataset&amp;gt; pInGeoDataset;
hr = pRaster.QueryInterface(&amp;amp;pInGeoDataset);

// Project it into the new Spatial Reference
CComPtr&amp;lt;IGeoDataset&amp;gt; pOutGeoDataset;
hr = pTransform-&amp;gt;ProjectFast(pInGeoDataset, pSpatialRef, esriGeoAnalysisResampleCubic, &amp;amp;vMissing, &amp;amp;pOutGeoDataset);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
// Get the resulting RasterDataset
CComPtr&amp;lt;IRasterDataset&amp;gt; pReprojRasterDataset;
hr = pOutGeoDataset.QueryInterface(&amp;amp;pReprojRasterDataset);

// Get the reprojected raster from the new dataset
CComPtr&amp;lt;IRaster&amp;gt; pReprojRaster;
hr = pReprojRasterDataset-&amp;gt;CreateDefaultRaster(&amp;amp;pReprojRaster);

// Load it into the existing File Geodatabase
hr = pRasterLoader-&amp;gt;Load(pRasterDataset, pReprojRaster);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the resultant raster isn't reprojected.&amp;nbsp; Any clues as to what I am mis-understanding?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 13:16:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/reprojection-while-loading-rasters/m-p/598873#M16082</guid>
      <dc:creator>ChrisBarrington_Brown</dc:creator>
      <dc:date>2010-09-10T13:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reprojection while loading Rasters</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/reprojection-while-loading-rasters/m-p/598874#M16083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you see the code snippet online: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_project_a_raster_with_a_datum_transformation/0001000003t8000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_project_a_raster_with_a_datum_transformation/0001000003t8000000/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;It talks about reprojecting a raster. The saveas call in the end just needs to go to your geodatabase rather than file system. I think that should do it.&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, 10 Sep 2010 14:26:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/reprojection-while-loading-rasters/m-p/598874#M16083</guid>
      <dc:creator>RobertBerger</dc:creator>
      <dc:date>2010-09-10T14:26:48Z</dc:date>
    </item>
  </channel>
</rss>

