<?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: ArcGIS Pro SDK Raster Save Equivalent in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-raster-save-equivalent/m-p/831897#M3367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Douglas,&lt;/P&gt;&lt;P&gt;The same situation is with Euclidean distance geoprocessing tool. Look at this how I do in that case:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/245178-when-will-net-developers-get-api-reference-for-all-geoprocessing-functions"&gt;https://community.esri.com/thread/245178-when-will-net-developers-get-api-reference-for-all-geoprocessing-functions&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Oct 2020 07:08:25 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2020-10-02T07:08:25Z</dc:date>
    <item>
      <title>ArcGIS Pro SDK Raster Save Equivalent</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-raster-save-equivalent/m-p/831896#M3366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the equivalent of raster save using ArcGIS Pro SDK C#&lt;/P&gt;&lt;P&gt;Arcpy Code&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;in_raster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Raster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'c:/data/inraster'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
new_raster&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'c:/output/outraster1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given this example here -&amp;nbsp;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/arcgis-pro-net/analytics/executing-spatial-analyst-tools-using-arcgis-pro-sdk-2/" title="https://www.esri.com/arcgis-blog/products/arcgis-pro-net/analytics/executing-spatial-analyst-tools-using-arcgis-pro-sdk-2/" rel="nofollow noopener noreferrer" target="_blank"&gt;Executing Spatial Analyst Tools Using ArcGIS Pro SDK&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typically you could just set the output raster in the Value Array, as done here&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; valueArray &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MakeValueArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;maExpression&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outRaster&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; gpresult1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ExecuteToolAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;RasterCalculator_sa&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; valueArray&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However that changes, if the tool you are running does not have an output raster that you can set. The CutFill Spatial Analyst returns a raster, but I would like to save that raster somewhere instead of using CopyRaster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example,&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/cut-fill.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/cut-fill.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Cut Fill (Spatial Analyst)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; valueArray &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MakeValueArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inputRasterOne&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; inputRasterTwo&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; gpresult1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ExecuteToolAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;CutFill_sa&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; valueArray&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 id="toc-hId-2015677888"&gt;UPDATE&lt;/H1&gt;&lt;P&gt;based on my friend's answer &lt;A href="https://community.esri.com/migrated-users/267057" target="_blank"&gt;Gintautas Kmieliauskas&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;the correct solution is to put the output raster in the value array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my example, I referenced &lt;A href="http://webhelp.esri.com/arcgiSDEsktop/9.3/index.cfm?TopicName=cut/fill_" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS 9.3 Cut Fill&lt;/A&gt;&amp;nbsp;and followed the same and it worked.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; valueArray &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MakeValueArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inputRasterOne&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; inputRasterTwo&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outputRaster&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; gpresult1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ExecuteToolAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;CutFill_sa&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; valueArray&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:03:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-raster-save-equivalent/m-p/831896#M3366</guid>
      <dc:creator>DouglasLong</dc:creator>
      <dc:date>2021-12-12T10:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK Raster Save Equivalent</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-raster-save-equivalent/m-p/831897#M3367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Douglas,&lt;/P&gt;&lt;P&gt;The same situation is with Euclidean distance geoprocessing tool. Look at this how I do in that case:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/245178-when-will-net-developers-get-api-reference-for-all-geoprocessing-functions"&gt;https://community.esri.com/thread/245178-when-will-net-developers-get-api-reference-for-all-geoprocessing-functions&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2020 07:08:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-raster-save-equivalent/m-p/831897#M3367</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2020-10-02T07:08:25Z</dc:date>
    </item>
  </channel>
</rss>

