<?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 ArcPy NumPyArrayToRaster not working properly (Python) in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145073#M6306</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am trying to convert my NumPy array of shape (360,700,450) to multidimensional raster file. My goal is to export raster data to point feature layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to do is timeseries of average temperature for certain points. I have my temperature data stored in NetCDF file, which I am trying to convert to raster, so I can use ExtractMultiValuesToPoints method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly I made a cycle, which converted n-th dimension of .nc file to 2D array, then converted to raster using NumPyArrayToRaster, then extracted data to points and removed raster. The cycle repeated this for all days of timeseries. This worked fine but whole process took a long long time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I wanted to do is firstly make 3D array, with first dimension value of "day". I created array succesfuly but using&amp;nbsp;&lt;SPAN&gt;NumPyArrayToRaster I am unable to create multidimensional raster. Process works just fine, I get "succesful" message after finishing&amp;nbsp;NumPyArrayToRaster&amp;nbsp;. However, &lt;STRONG&gt;I am unable&lt;/STRONG&gt; to generate something else than singleband raster.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;S&lt;STRONG&gt;o again, the problem is:&amp;nbsp;&lt;/STRONG&gt;NumPyArrayToRaster always returns singleband raster, no matter how many dimensions does the array have.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ArcGIS Pro 2.4&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Aug 2019 19:23:33 GMT</pubDate>
    <dc:creator>LubomirFranko</dc:creator>
    <dc:date>2019-08-01T19:23:33Z</dc:date>
    <item>
      <title>ArcPy NumPyArrayToRaster not working properly (Python)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145073#M6306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am trying to convert my NumPy array of shape (360,700,450) to multidimensional raster file. My goal is to export raster data to point feature layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to do is timeseries of average temperature for certain points. I have my temperature data stored in NetCDF file, which I am trying to convert to raster, so I can use ExtractMultiValuesToPoints method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly I made a cycle, which converted n-th dimension of .nc file to 2D array, then converted to raster using NumPyArrayToRaster, then extracted data to points and removed raster. The cycle repeated this for all days of timeseries. This worked fine but whole process took a long long time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I wanted to do is firstly make 3D array, with first dimension value of "day". I created array succesfuly but using&amp;nbsp;&lt;SPAN&gt;NumPyArrayToRaster I am unable to create multidimensional raster. Process works just fine, I get "succesful" message after finishing&amp;nbsp;NumPyArrayToRaster&amp;nbsp;. However, &lt;STRONG&gt;I am unable&lt;/STRONG&gt; to generate something else than singleband raster.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;S&lt;STRONG&gt;o again, the problem is:&amp;nbsp;&lt;/STRONG&gt;NumPyArrayToRaster always returns singleband raster, no matter how many dimensions does the array have.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ArcGIS Pro 2.4&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 19:23:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145073#M6306</guid>
      <dc:creator>LubomirFranko</dc:creator>
      <dc:date>2019-08-01T19:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy NumPyArrayToRaster not working properly (Python)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145074#M6307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like there is a bug logged for this:&amp;nbsp;&lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDExNDExNw=="&gt;https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDExNDExNw==&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That link lists a workaround of compositing the single band output back into a multi-band raster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 19:34:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145074#M6307</guid>
      <dc:creator>KoryKramer</dc:creator>
      <dc:date>2019-08-01T19:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy NumPyArrayToRaster not working properly (Python)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145075#M6308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Feels little bit strange that bug is reported for ArcGIS Desktop only and also that it's already been a year since the bug was reported for the first time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your answer tho. I had a look at alternate solutions but as I mentioned above, I want to extract data from multidimensional raster, because it is way faster than generating 5 000 singleband rasters, merging them together, nd extracting multidimensional data to points afterwards (this would take like 6 hours of processing time on pretty good setup (tested)).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 20:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145075#M6308</guid>
      <dc:creator>LubomirFranko</dc:creator>
      <dc:date>2019-08-01T20:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy NumPyArrayToRaster not working properly (Python)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145076#M6309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your data are already in array format, why don't you use numpy (or alternatives).&lt;/P&gt;&lt;P&gt;I usually have the reverse problem going from rasters to arrays to do things like cell statistics on raster composites.&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2018/02/06/cell-statistics-made-easy-raster-data-over-time"&gt;/blogs/dan_patterson/2018/02/06/cell-statistics-made-easy-raster-data-over-time&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can't do what you want with netcdf files, getting them into numpy array format might be quicker than dealing with esri rasters or tif files and trying to stack those.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 23:53:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145076#M6309</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-08-01T23:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy NumPyArrayToRaster not working properly (Python)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145077#M6310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV style="color: #222222; font-family: Arial,Helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;DIV&gt;Well, as I mentioned in first post, I already have my data in NumPy Array format. To perform point timeseries, I need to extract values at point locations. Thats why I need raster with multiple layers.&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-family: Arial,Helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-family: Arial,Helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Next thing I’ve been thinking of is to get point values from exact pixels in array. There might be a problem with interpolation however. If the point is located at the edge of a “array pixel”, the value which I want is not the value of a pixel but interpolated value of 2 neigbouring pixels. NumPyArrayToRaster provides the interpolation I need.&amp;nbsp;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-family: Arial,Helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-family: Arial,Helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;As I said, I am able to perform timeseries by extraction data to points from temporary singleband raster in &lt;EM&gt;while loop.&amp;nbsp;&lt;/EM&gt;However, extracting data to points from raster one by one takes a lot of tim&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 07:03:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145077#M6310</guid>
      <dc:creator>LubomirFranko</dc:creator>
      <dc:date>2019-08-02T07:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy NumPyArrayToRaster not working properly (Python)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145078#M6311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recently ran into this bug when trying to export a multi-dimensional array (from netCDF) to raster using NumpyArrayToRaster in ArcGIS Desktop 10.8. It is a bit disappointing that the bug was reported in 10.6 and has not been&amp;nbsp;resolved more than 2 years later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried using this tool in ArcGIS Pro 2.5.0 and found mixed results. When saving to a GeoTiff, the result was a multi-band raster. When saving to GRID format, the tool builds BOTH a multi-band raster&amp;nbsp;AND multiple 1-band rasters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2020 21:19:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-numpyarraytoraster-not-working-properly/m-p/145078#M6311</guid>
      <dc:creator>KevinSampson</dc:creator>
      <dc:date>2020-07-07T21:19:41Z</dc:date>
    </item>
  </channel>
</rss>

