<?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 Save raster statistics in a table using GIS model builder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/save-raster-statistics-in-a-table-using-gis-model/m-p/1045703#M25418</link>
    <description>&lt;P&gt;I have a set of 50 raster and and a polygon. I am trying to build a model which will input each raster and calculate raster statistics such as mean, max, min as per the polygon zone and create output in a table. So the output table will have 50 rows (each row for each raster) and 3 columns (mean, max, min). Any guidelines are welcome. I am new to model builder and only able to iterate raster as input and calculate the statistics but unable to save it in table. Thanks.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Apr 2021 19:45:23 GMT</pubDate>
    <dc:creator>RupayanSaha</dc:creator>
    <dc:date>2021-04-10T19:45:23Z</dc:date>
    <item>
      <title>Save raster statistics in a table using GIS model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/save-raster-statistics-in-a-table-using-gis-model/m-p/1045703#M25418</link>
      <description>&lt;P&gt;I have a set of 50 raster and and a polygon. I am trying to build a model which will input each raster and calculate raster statistics such as mean, max, min as per the polygon zone and create output in a table. So the output table will have 50 rows (each row for each raster) and 3 columns (mean, max, min). Any guidelines are welcome. I am new to model builder and only able to iterate raster as input and calculate the statistics but unable to save it in table. Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Apr 2021 19:45:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/save-raster-statistics-in-a-table-using-gis-model/m-p/1045703#M25418</guid>
      <dc:creator>RupayanSaha</dc:creator>
      <dc:date>2021-04-10T19:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Save raster statistics in a table using GIS model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/save-raster-statistics-in-a-table-using-gis-model/m-p/1045732#M25419</link>
      <description>&lt;P&gt;First, you need to create the desired schema for the target table. To do this, run the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/zonal-statistics-as-table.htm#" target="_self"&gt;&lt;STRONG&gt;Zonal Statistics as Table&lt;/STRONG&gt;&lt;/A&gt; tool, using one raster and a zonal feature class. Keep Statistics Type as "ALL". From the output table &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/delete-field.htm" target="_self"&gt;&lt;STRONG&gt;delete the undesired fields&lt;/STRONG&gt;&lt;/A&gt;, and &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-field.htm" target="_self"&gt;add any desired field&lt;/A&gt; (e.g. RASTER Name).&lt;/P&gt;&lt;P&gt;You can&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/truncatetable.htm" target="_self"&gt; truncate the table&lt;/A&gt;, if required. It will remove the row, as the row will be added again when you run the model.&lt;/P&gt;&lt;P&gt;Here is how my example table schema looks like.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jayanta_Poddar_0-1618138101413.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10562i62545F71506A78B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jayanta_Poddar_0-1618138101413.png" alt="Jayanta_Poddar_0-1618138101413.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;RASTER is a text field which will be filled with the name of corresponding Raster file.&lt;/P&gt;&lt;P&gt;__________________________________________________________________________________________________&lt;/P&gt;&lt;P&gt;My Model looks like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jayanta_Poddar_1-1618138227052.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10563i39B01569F1F27352/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jayanta_Poddar_1-1618138227052.png" alt="Jayanta_Poddar_1-1618138227052.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In Model Builder,&lt;/P&gt;&lt;P&gt;1. Used &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/modelbuilder-toolbox/iterate-rasters.htm" target="_self"&gt;Iterate Rasters&lt;/A&gt; to go through all raster files within a workspace (Filtered with Raster Format).&lt;/P&gt;&lt;P&gt;2. &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/zonal-statistics-as-table.htm#" target="_self"&gt;Zonal Statistics as Table&lt;/A&gt;. Added the Zone Feature Class, and linked the above raster(s) as Input Value Raster.&lt;/P&gt;&lt;P&gt;3. (Optional) I have added a field for Raster Name. You may use this step, if you want to add the Raster names to their corresponding rows. Else skip the step.&lt;/P&gt;&lt;P&gt;Use Add field to add an additional field for the Raster Name. The Field Name and Field Type should be same as your corresponding Field Name in Target Table. In my example, the Field Name is RASTER and Field Type is TEXT.&lt;/P&gt;&lt;P&gt;Use Calculate Field to add the value (Raster Name) to the field.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jayanta_Poddar_2-1618138864617.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10564i572DE89AA033E9C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jayanta_Poddar_2-1618138864617.png" alt="Jayanta_Poddar_2-1618138864617.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Field Name: RASTER&lt;/P&gt;&lt;P&gt;Expression Type: PYTHON 3&lt;/P&gt;&lt;P&gt;Expression: &lt;FONT color="#FF0000"&gt;&lt;EM&gt;"%Name%"&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm" target="_self"&gt;&lt;STRONG&gt;Append&lt;/STRONG&gt;&lt;/A&gt;. The previously created table would be your target dataset. And link the output table of Calculate Field, as your input datasets.&lt;/P&gt;&lt;P&gt;Change Field Matching Type to "&lt;SPAN&gt;Use the Field Map to reconcile schema differences&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jayanta_Poddar_3-1618139177036.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10565i3535E1D1BBF9C583/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jayanta_Poddar_3-1618139177036.png" alt="Jayanta_Poddar_3-1618139177036.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Validate and Run the model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may truncate the target table before rerunning the model.&lt;/P&gt;&lt;P&gt;Here is how my target table looks like, after running the model.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jayanta_Poddar_4-1618139390224.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10566iB32D9985541C8892/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jayanta_Poddar_4-1618139390224.png" alt="Jayanta_Poddar_4-1618139390224.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Apr 2021 11:10:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/save-raster-statistics-in-a-table-using-gis-model/m-p/1045732#M25419</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-04-11T11:10:56Z</dc:date>
    </item>
  </channel>
</rss>

