<?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 NumPyArrayToRaster with string array in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/numpyarraytoraster-with-string-array/m-p/71062#M5807</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use the NumPyArrayToRaster for a string array&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using two input arrays: arcpy.RasterToNumPyArray(raster1) and arcpy.RasterToNumPyArray(raster2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;with dtype('uint8')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My output array is created from a loop that sums both input arrays in str format, something like: str(array1)+"+"+str(array2) with dtype='|S4'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try to export it to raster format I get the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;raceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;pyshell#103&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.NumPyArrayToRaster(outputarray)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\__init__.py", line 1165, in NumPyArrayToRaster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _NumPyArrayToRaster(*args, **kwargs)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ValueError: Argument in_array: Array type is not supported.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any limitation of type of arrays we can export to raster format ??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Apr 2012 08:57:39 GMT</pubDate>
    <dc:creator>RA1</dc:creator>
    <dc:date>2012-04-03T08:57:39Z</dc:date>
    <item>
      <title>NumPyArrayToRaster with string array</title>
      <link>https://community.esri.com/t5/python-questions/numpyarraytoraster-with-string-array/m-p/71062#M5807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use the NumPyArrayToRaster for a string array&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using two input arrays: arcpy.RasterToNumPyArray(raster1) and arcpy.RasterToNumPyArray(raster2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;with dtype('uint8')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My output array is created from a loop that sums both input arrays in str format, something like: str(array1)+"+"+str(array2) with dtype='|S4'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try to export it to raster format I get the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;raceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;pyshell#103&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.NumPyArrayToRaster(outputarray)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\__init__.py", line 1165, in NumPyArrayToRaster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _NumPyArrayToRaster(*args, **kwargs)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ValueError: Argument in_array: Array type is not supported.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any limitation of type of arrays we can export to raster format ??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 08:57:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/numpyarraytoraster-with-string-array/m-p/71062#M5807</guid>
      <dc:creator>RA1</dc:creator>
      <dc:date>2012-04-03T08:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: NumPyArrayToRaster with string array</title>
      <link>https://community.esri.com/t5/python-questions/numpyarraytoraster-with-string-array/m-p/71063#M5808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're probably better off working the arrays as array objects instead of strings, especially if you're eventually going to convert them to a raster. I've never seen a raster with text for values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 11:41:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/numpyarraytoraster-with-string-array/m-p/71063#M5808</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2012-04-03T11:41:12Z</dc:date>
    </item>
  </channel>
</rss>

