<?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: Problem with NumPyArrayToRaster in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/problem-with-numpyarraytoraster/m-p/691556#M2295</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: fabl&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I dont use service pack 4. Maybe the problem is solved there. I will check this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By default there is no extent set:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; print arcpy.env.extent
None
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;It is possible to set one on the environments Application-level, of course. But I did not so.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:06:15 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T05:06:15Z</dc:date>
    <item>
      <title>Problem with NumPyArrayToRaster</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-with-numpyarraytoraster/m-p/691554#M2293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;NumPyArrayToRaster ignores the lower_left_corner if an extent ist set. The result is stupid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did following to check the problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;New mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Create Random Raster with defaults.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Python window:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; LL = arcpy.Raster('CreateRandom1').extent.lowerLeft
&amp;gt;&amp;gt;&amp;gt; LL.X += 100
&amp;gt;&amp;gt;&amp;gt; LL.Y += 100
&amp;gt;&amp;gt;&amp;gt; numras = arcpy.RasterToNumPyArray('CreateRandom1', LL, 100, 100, arcpy.Raster('CreateRandom1').noDataValue)
&amp;gt;&amp;gt;&amp;gt; numras.shape
(100, 100)
&amp;gt;&amp;gt;&amp;gt; LL
&amp;lt;Point (100.0, 100.0, #, #)&amp;gt;
&amp;gt;&amp;gt;&amp;gt; outras = arcpy.NumPyArrayToRaster(numras, LL, 1, 1, arcpy.Raster('CreateRandom1').noDataValue)
&amp;gt;&amp;gt;&amp;gt; arcpy.env.extent
&amp;gt;&amp;gt;&amp;gt; arcpy.env.extent = arcpy.Raster('CreateRandom1').extent
&amp;gt;&amp;gt;&amp;gt; outras1 = arcpy.NumPyArrayToRaster(numras, LL, 1, 1, arcpy.Raster('CreateRandom1').noDataValue)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Results:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CreateRandom1 and outras (without extent):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]13488[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CreateRandom1 and outras1 (with extent, yellow:NoData)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]13489[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The LL-Parameter is unused in outras1. The extent is not the extent of the NumPyArray. outras2 is set to the upperleft-corner of the extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my opinion this is wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Solution: Setting the extent before calling NumPyArrayToRaster. Maybe it is necessary to buffer the extent for other reasons before changing it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:06:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-with-numpyarraytoraster/m-p/691554#M2293</guid>
      <dc:creator>FabianBlau</dc:creator>
      <dc:date>2021-12-12T05:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with NumPyArrayToRaster</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-with-numpyarraytoraster/m-p/691555#M2294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't get the same results as you. When I follow your steps exactly, LL is &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;not&lt;/SPAN&gt;&lt;SPAN&gt; unused for outras1. It lines up in exactly the same place as outras. I'm using AGD 10.0, service pack 4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I'm not sure what you're trying to show by changing the extent. That won't change where the rasters line up. By default, the extent window is set to the maximum of your inputs ('CreateRandom1' in this case). Setting the extent to 'CreateRandom1.extent' doesn't change anything at all, since that &lt;/SPAN&gt;&lt;STRONG&gt;is&lt;/STRONG&gt;&lt;SPAN&gt; the input with the maximum extent.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 19:02:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-with-numpyarraytoraster/m-p/691555#M2294</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2012-04-16T19:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with NumPyArrayToRaster</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-with-numpyarraytoraster/m-p/691556#M2295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: fabl&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I dont use service pack 4. Maybe the problem is solved there. I will check this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By default there is no extent set:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; print arcpy.env.extent
None
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;It is possible to set one on the environments Application-level, of course. But I did not so.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:06:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-with-numpyarraytoraster/m-p/691556#M2295</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T05:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with NumPyArrayToRaster</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-with-numpyarraytoraster/m-p/691557#M2296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;By default there is no extent set:&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ah yes, you're right. I must have set this a while ago.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 11:54:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-with-numpyarraytoraster/m-p/691557#M2296</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2012-04-17T11:54:21Z</dc:date>
    </item>
  </channel>
</rss>

