<?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: Raster function equivalent of Build Raster Attribute Table in ArcGIS Image Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-image-analyst-questions/raster-function-equivalent-of-build-raster/m-p/1124862#M91</link>
    <description>&lt;P&gt;what kind of raster is it?&amp;nbsp; normally a float raster has to be converted to an int raster in order to build a raster attribute table.&amp;nbsp; The only thing that I can find to do zonal crosstab (aka counts) is xarray's zonal.crosstab, it is shipped with Pro 2.9&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://xarray-spatial.org/reference/_autosummary/xrspatial.zonal.crosstab.html?highlight=zonal%20crosstab#xrspatial.zonal.crosstab" target="_blank"&gt;xrspatial.zonal.crosstab — xarray_spatial 0.3.0+g9a8909e-dirty documentation (xarray-spatial.org)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;it produces a pandas df (pandas is also installed)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Dec 2021 15:01:20 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-12-10T15:01:20Z</dc:date>
    <item>
      <title>Raster function equivalent of Build Raster Attribute Table</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/raster-function-equivalent-of-build-raster/m-p/1124839#M90</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to include the output of a raster function into the Tabulate Area GP tool, but my raster function output does not have an attribute table. If it were a traditional raster, then I would have run the&amp;nbsp; Build Raster Attribute Table gp tool to create one.&amp;nbsp; Is there a raster function equivalent or is there a different approach to follow? I need to work with categorical data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 13:55:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/raster-function-equivalent-of-build-raster/m-p/1124839#M90</guid>
      <dc:creator>MervynLotter</dc:creator>
      <dc:date>2021-12-10T13:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Raster function equivalent of Build Raster Attribute Table</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/raster-function-equivalent-of-build-raster/m-p/1124862#M91</link>
      <description>&lt;P&gt;what kind of raster is it?&amp;nbsp; normally a float raster has to be converted to an int raster in order to build a raster attribute table.&amp;nbsp; The only thing that I can find to do zonal crosstab (aka counts) is xarray's zonal.crosstab, it is shipped with Pro 2.9&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://xarray-spatial.org/reference/_autosummary/xrspatial.zonal.crosstab.html?highlight=zonal%20crosstab#xrspatial.zonal.crosstab" target="_blank"&gt;xrspatial.zonal.crosstab — xarray_spatial 0.3.0+g9a8909e-dirty documentation (xarray-spatial.org)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;it produces a pandas df (pandas is also installed)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 15:01:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/raster-function-equivalent-of-build-raster/m-p/1124862#M91</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-10T15:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Raster function equivalent of Build Raster Attribute Table</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/raster-function-equivalent-of-build-raster/m-p/1124866#M92</link>
      <description>&lt;P&gt;Of course you can do it in numpy using RasterToNumPyArray to get a raster out to an array&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import numpy as np
a = np.random.randint(0, 4, size=100).reshape(10, 10)
b = np.random.randint(4, 8, size=100).reshape(10, 10)
ab = np.vstack((a.ravel(), b.ravel())).T
u, cnts = np.unique(ab, return_counts=True, axis=0)

a  # -- zone raster 
array([[0, 1, 0, 2, 2, 1, 2, 0, 1, 0],
       [0, 3, 0, 2, 1, 3, 0, 0, 2, 0],
       [0, 1, 2, 1, 2, 3, 1, 0, 0, 3],
       [2, 1, 1, 2, 0, 0, 1, 3, 3, 2],
       [0, 0, 2, 2, 0, 0, 0, 0, 1, 1],
       [3, 1, 2, 0, 0, 1, 2, 1, 1, 0],
       [0, 0, 3, 0, 3, 1, 2, 3, 0, 0],
       [0, 3, 3, 1, 3, 1, 3, 1, 2, 3],
       [3, 0, 0, 1, 3, 2, 2, 1, 0, 0],
       [1, 1, 0, 2, 3, 3, 1, 1, 1, 1]])

b  # -- values raster
array([[5, 6, 4, 6, 4, 7, 7, 6, 6, 4],
       [6, 4, 6, 4, 7, 6, 4, 7, 4, 6],
       [4, 4, 7, 5, 4, 7, 6, 7, 5, 4],
       [7, 6, 5, 6, 7, 4, 7, 4, 5, 5],
       [4, 7, 4, 6, 7, 5, 5, 4, 4, 7],
       [4, 6, 7, 4, 7, 6, 6, 6, 6, 4],
       [4, 6, 7, 6, 4, 7, 4, 5, 6, 4],
       [4, 6, 6, 6, 4, 4, 4, 4, 6, 5],
       [4, 7, 7, 7, 6, 5, 5, 6, 7, 5],
       [4, 4, 5, 5, 4, 6, 5, 5, 6, 6]])

u  # -- unique combinations
array([[0, 4],
       [0, 5],
       [0, 6],
       [0, 7],
       [1, 4],
       [1, 5],
       [1, 6],
       [1, 7],
       [2, 4],
       [2, 5],
       [2, 6],
       [2, 7],
       [3, 4],
       [3, 5],
       [3, 6],
       [3, 7]])

cnts  # -- counts per combination
array([12,  6,  7,  9,  6,  4, 12,  6,  6,  4,  5,  4,  9,  3,  5,  2],
      dtype=int64)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 15:16:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/raster-function-equivalent-of-build-raster/m-p/1124866#M92</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-10T15:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Raster function equivalent of Build Raster Attribute Table</title>
      <link>https://community.esri.com/t5/arcgis-image-analyst-questions/raster-function-equivalent-of-build-raster/m-p/1124903#M93</link>
      <description>&lt;P&gt;My understanding is that raster functions are on the fly animals that process at a dynamic resolution and window, so seems to me the idea of a raster table wouldn't really apply, as you need a complete dataset to calculate cell counts and a list of unique values.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 16:22:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-analyst-questions/raster-function-equivalent-of-build-raster/m-p/1124903#M93</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-10T16:22:03Z</dc:date>
    </item>
  </channel>
</rss>

