<?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: Arcpy RasterToNumPyArray Conversion Problem in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457922#M15414</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Hi Stephen,&lt;BR /&gt;&lt;BR /&gt;From what you describe, sounds like your issue is slightly different to Aaron's with a shift in the raster dataset when you convert it from a NumPyArray back to a raster. &lt;BR /&gt;&lt;BR /&gt;I'd like to take a look and see if I can help you resolve this issue. Could you please send me a sample dataset where you are seeing this behavior? If the data isn't too large, you can zip and email it to me at&lt;/SPAN&gt;&lt;A class="" href="mailto:NRajasekar@esri.com" style="color: #287433; background-color: #ffffff; border: 0px; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;NRajasekar@esri.com&lt;/A&gt;&lt;SPAN style="background-color: #ffffff;"&gt;. If the data is too large for email, shoot me an email anyway and I can send you instructions to upload the data to a cloud storage site.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Neeraj&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Apr 2017 17:39:20 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2017-04-06T17:39:20Z</dc:date>
    <item>
      <title>Arcpy RasterToNumPyArray Conversion Problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457916#M15408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am executing arcpy commands from the python window in ArcMap 10.41. I am creating an arcpy Raster object using a raster layer from the table of contents. I want to then convert the raster object to a numpy array object so that I can run it through some scripted routines resulting in a raster output. With that said, I've noticed some odd behavior when creating the arcpy Raster object which seems to impact the creation of the numpy array object.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The properties for the input raster layer are below. Note that the number of columns and rows is 4800 each.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/345484_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After creating the raster object in the python window, I took a look at the&amp;nbsp;height (rst.height) and width (rst.width) properties. To my surprise, they did not match. However, when I execute 'arcpy.Describe(rst).height' and&amp;nbsp;&lt;SPAN&gt;'arcpy.Describe(rst).width' I get 4800 for both (See image below). &lt;/SPAN&gt;Can anyone explain this behavior?&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/345483_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;Additionally, when I convert the raster object to a numpy array is get the dimensions (4800, 4799) which then carries over into any raster I make.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of this raster layer, I'm losing the far right column during the conversions. In some over cases, I'm losing the bottom row of the raster layer. Initially I assumed the problem had something to do with the precision of the lat/lon values in the lower-left corner. After adjusting those I was able to get the correct number of rows and columns, but the data for the row or column that was missing initially was filled with nodata values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone experienced and/or solved this before?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 21:03:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457916#M15408</guid>
      <dc:creator>AaronFriesz2</dc:creator>
      <dc:date>2017-04-05T21:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy RasterToNumPyArray Conversion Problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457917#M15409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the issue is with the use of long/lat data.&amp;nbsp; As an intermediate test, you could try to convert out to an esri grid and try converting it to the numpy array.&amp;nbsp; I have produced much larger arrays, but I don't normally use tif files nor data which are in geographic coordinates.&amp;nbsp; The truncation could simply be floating point issues with the calculation of rows and columns.&amp;nbsp; If it is really an issue, then you could always produce an empty array or an array of zeros with the appropriate shape and 'add' your raster into it.. but that would be overkill for an extra row, when you can simply truncate your other arrays or set the extent differently&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;z&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;zeros&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dtype&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'int'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;arange&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;reshape&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

z&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; a

z
Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;24&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;8&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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>Sat, 11 Dec 2021 20:22:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457917#M15409</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T20:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy RasterToNumPyArray Conversion Problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457918#M15410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am converting the raster to a numpy array using the arcpy's RasterToNumpyArray function. During that conversion is where I lose the row and the data it contains. At the moment I am restricted to using arcpy and numpy to do the conversion, and I don't want to add any more dependencies to ArcGIS tool I'm developing. Is there a way to add the raster data values to an empty array without using the RasterToNumpyArray function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did just notice something with the arcpy raster object...when I run the command 'rst.width' &amp;nbsp;I get '4799L'. However, if I pick a point from column 4800 from the image in my display and request the cell value for that point from my raster object (rst), I get the correct data value in return. So, while the raster object properties says it's of length 4799, the object still contains data values for column 4800. However those data values are not being transfer into the numpy array.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 14:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457918#M15410</guid>
      <dc:creator>AaronFriesz2</dc:creator>
      <dc:date>2017-04-06T14:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy RasterToNumPyArray Conversion Problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457919#M15411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been having a similar issue. I posted about it on the&amp;nbsp;&lt;A href="http://gis.stackexchange.com/questions/234823/cell-shift-when-converting-raster-to-array" rel="nofollow noopener noreferrer" target="_blank"&gt;gis stack exchange&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have recently been having some issues converting rasters to numpy arrays. The RasterToNumPyArray tool seems to be adding or subtracting rows or columns depending on which dataset I'm working on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance I have a raster that contains 114 rows, and 160 columns. After converting it to an array it has 115 rows, and 160 column. If I convert this array back to a raster the data appears to be shifted up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried specifying the number of rows and columns to process in the RasterToNumPyArray tool. The row and column count issue is fixed but the output raster is still shifted up one row and the top row of data gets deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue happens whether the data is in a geographic or projected coordinate system. Any idea why this would be happening? I am including a python script where I was seeing this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; numpy &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; np

&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; os &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; path

env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outputCoordinateSystem &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4326&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

input_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'PATH_TO_INPUT_RASTER'&lt;/SPAN&gt;
input_ras_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basename&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;input_ras&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

ras_desc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;input_ras&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
rows &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ras_desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;height
cols &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ras_desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;width
x_cell_size &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ras_desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;meanCellWidth
y_cell_size &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ras_desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;meanCellHeight

lower_left_corner &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;XMin&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ras_desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;YMin&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; input_ras_name
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'rows:'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; rows
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'cols:'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cols
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; lower_left_corner

arr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RasterToNumPyArray&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;input_ras&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lower_left_corner&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cols&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; rows&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9999&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\narry based on input raster'&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'rows:'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;shape&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'cols:'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;shape&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\nconverting array back to a raster'&lt;/SPAN&gt;

output_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NumPyArrayToRaster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lower_left_corner&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; input_ras&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; input_ras&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
output_ras&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;'PATH_TO_OUTPUT_RASTER'&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;I also explored the row and column count a little more. The attached screen shot shows the row and column count three different ways - one of which is different. Could this mean anything?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem does not seem to occur after converting my tif to a GRID and then processing the data. Ideally though I would not want to perform this intermediate step.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:22:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457919#M15411</guid>
      <dc:creator>StephenPalka1</dc:creator>
      <dc:date>2021-12-11T20:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy RasterToNumPyArray Conversion Problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457920#M15412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is the tif thing then, I never have any problems with esri grids&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 16:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457920#M15412</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-04-06T16:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy RasterToNumPyArray Conversion Problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457921#M15413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aaron,&lt;BR /&gt;&lt;BR /&gt;I'd like to take a look and see if I can help you resolve this issue. Could you please send me a sample dataset where you are seeing this behavior? If the data isn't too large, you can zip and email it to me at&amp;nbsp;&lt;A href="mailto:NRajasekar@esri.com"&gt;NRajasekar@esri.com&lt;/A&gt;&amp;nbsp;. If the data is too large for email, shoot me an email anyway and I can send you instructions to upload the data to a cloud storage site.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Neeraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 17:32:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457921#M15413</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-04-06T17:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy RasterToNumPyArray Conversion Problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457922#M15414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Hi Stephen,&lt;BR /&gt;&lt;BR /&gt;From what you describe, sounds like your issue is slightly different to Aaron's with a shift in the raster dataset when you convert it from a NumPyArray back to a raster. &lt;BR /&gt;&lt;BR /&gt;I'd like to take a look and see if I can help you resolve this issue. Could you please send me a sample dataset where you are seeing this behavior? If the data isn't too large, you can zip and email it to me at&lt;/SPAN&gt;&lt;A class="" href="mailto:NRajasekar@esri.com" style="color: #287433; background-color: #ffffff; border: 0px; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;NRajasekar@esri.com&lt;/A&gt;&lt;SPAN style="background-color: #ffffff;"&gt;. If the data is too large for email, shoot me an email anyway and I can send you instructions to upload the data to a cloud storage site.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Neeraj&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 17:39:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457922#M15414</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-04-06T17:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy RasterToNumPyArray Conversion Problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457923#M15415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After some back and forth, Neeraj was able to replicate the behavior&amp;nbsp;and concluded that&amp;nbsp;the problem is a bug in the software.&lt;/P&gt;&lt;P style="margin: 0px 0px 12pt; color: #222222; font-size: 12.8px; text-indent: 0px; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;For now a simple workaround is&amp;nbsp;as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="margin-bottom: 0in; color: #222222; font-size: 12.8px; text-indent: 0px; background-color: #ffffff;"&gt;&lt;LI style="margin: 0px 0px 0px 0in;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;In the first step, when creating a raster object, point directly to the raster dataset instead of a raster layer that is added to your map.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin: 0px 0px 0px 0in;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;For example, If you had this dataset in a folder, say &lt;SPAN style="color: #4472c4;"&gt;‘C:\temp1’&lt;/SPAN&gt;, you would do sometime like,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/349423_pastedImage_1.png" style="width: 620px; height: 217px;" /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin: 0px 0px 0px 0in;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;This should preserve all the rows and columns in the original raster.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 14:07:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457923#M15415</guid>
      <dc:creator>AaronFriesz2</dc:creator>
      <dc:date>2017-05-03T14:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy RasterToNumPyArray Conversion Problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457924#M15416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fixes in 10.5.1&lt;/P&gt;&lt;P&gt;BUG-000090833 Raster cell values are unexpectedly shifted when converted to a NumPy array and then back to a raster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 02:13:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-rastertonumpyarray-conversion-problem/m-p/457924#M15416</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-06-30T02:13:51Z</dc:date>
    </item>
  </channel>
</rss>

