<?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: Unique values in raster table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/unique-values-in-raster-table/m-p/227522#M17641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I assume you mean "store the individual values" (one row for each pixel)...? Raster attribute tables are a list of unique values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Mar 2012 19:44:59 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2012-03-30T19:44:59Z</dc:date>
    <item>
      <title>Unique values in raster table</title>
      <link>https://community.esri.com/t5/python-questions/unique-values-in-raster-table/m-p/227520#M17639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a direct way to store all the unique values in raster attribute table? Right now, I am using a search cursor for attribute table and then, a for-loop to store the values. I wish GetRasterProperties_management would have "UNIQUEVALUES" in addition to the "UNIQUEVALUECOUNT"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Naresh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 18:05:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unique-values-in-raster-table/m-p/227520#M17639</guid>
      <dc:creator>NareshPai</dc:creator>
      <dc:date>2012-03-30T18:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Unique values in raster table</title>
      <link>https://community.esri.com/t5/python-questions/unique-values-in-raster-table/m-p/227521#M17640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't work much with rasters, so maybe this wouldn't work or ArcGIS doesn't support it, but can you run a selection like a "Select Distinct Value..." to get unique values? If so, you could then export them into a table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry if I'm off base here, I'm thinking in SQL, maybe this is not even on the horizon with rasters.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 19:31:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unique-values-in-raster-table/m-p/227521#M17640</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2012-03-30T19:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Unique values in raster table</title>
      <link>https://community.esri.com/t5/python-questions/unique-values-in-raster-table/m-p/227522#M17641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I assume you mean "store the individual values" (one row for each pixel)...? Raster attribute tables are a list of unique values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 19:44:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unique-values-in-raster-table/m-p/227522#M17641</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-03-30T19:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Unique values in raster table</title>
      <link>https://community.esri.com/t5/python-questions/unique-values-in-raster-table/m-p/227523#M17642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Darren, Thanks for your response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I would like to store all the values in the "Value" field of the table in a variable for categorical raster. The way I do it right now is,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;k=0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = arcpy.SearchCursor(RasterName,"","","Value","")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; val&lt;K&gt; = row.getValue("Value")&lt;/K&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; k = k + 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can this code be reduced?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Naresh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 19:52:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unique-values-in-raster-table/m-p/227523#M17642</guid>
      <dc:creator>NareshPai</dc:creator>
      <dc:date>2012-03-30T19:52:12Z</dc:date>
    </item>
  </channel>
</rss>

