<?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: Incorrect values in a raster in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/incorrect-values-in-a-raster/m-p/791535#M1549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on the provided code snippets it is hard to tell why you are seeing the results. We would need to take a look at what the Python code does and compare it to the Pro code. The usage of &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;currentPixelBlock &lt;/SPAN&gt;and &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;result&lt;/SPAN&gt; is pretty much undefined based on the given information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Dec 2017 01:18:57 GMT</pubDate>
    <dc:creator>ThomasEmge</dc:creator>
    <dc:date>2017-12-08T01:18:57Z</dc:date>
    <item>
      <title>Incorrect values in a raster</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/incorrect-values-in-a-raster/m-p/791534#M1548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm trying to save data as a raster. Right before editing a raster I save the result to CSV and plot it with python to compare results, see python_result.PNG. Since I cannot create raster dataset from scratch I save the orginal source raster and insert the values in. Then I save it again. The problem is the raster doesn't look anything like they should. First and second saved raster are not even identical. (See images.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea where the problem could be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;RasterStorageDef rasterStorageDef = new RasterStorageDef();
 rasterStorageDef.SetPyramidLevel(0);
 RasterDataset finalRaster = raster.SaveAs("FirstRaster.tiff", outputDataStore, rasterFormat, rasterStorageDef);

 Raster resultRaster = finalRaster.CreateRaster(new int[1] { 0 });
 resultRaster.SetNoDataValue(0);
 resultRaster.SetPixelType(RasterPixelType.DOUBLE);
 if (resultRaster.CanEdit()) {
 &amp;nbsp;&amp;nbsp;&amp;nbsp;MessageBox.Show("Cannot edit raster");
 &amp;nbsp;&amp;nbsp;&amp;nbsp;return;
 }

 currentPixelBlock.Clear(0);
 resultRaster.Write(0, 0, currentPixelBlock);

 PixelBlock newPixelBlock = resultRaster.CreatePixelBlock(resultRaster.GetWidth(), resultRaster.GetHeight());
 newPixelBlock.SetPixelData(0, result.Transpose());
 resultRaster.Write(0, 0, newPixelBlock);
 resultRaster.Refresh();

 resultRaster.SaveAs("SecondRaster.tiff", outputDataStore, rasterFormat, rasterStorageDef);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:55:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/incorrect-values-in-a-raster/m-p/791534#M1548</guid>
      <dc:creator>JakubCech</dc:creator>
      <dc:date>2021-12-12T16:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect values in a raster</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/incorrect-values-in-a-raster/m-p/791535#M1549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on the provided code snippets it is hard to tell why you are seeing the results. We would need to take a look at what the Python code does and compare it to the Pro code. The usage of &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;currentPixelBlock &lt;/SPAN&gt;and &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;result&lt;/SPAN&gt; is pretty much undefined based on the given information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 01:18:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/incorrect-values-in-a-raster/m-p/791535#M1549</guid>
      <dc:creator>ThomasEmge</dc:creator>
      <dc:date>2017-12-08T01:18:57Z</dc:date>
    </item>
  </channel>
</rss>

