<?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: how to parse the raster name into a table in model builder or python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-parse-the-raster-name-into-a-table-in-model/m-p/1045827#M60737</link>
    <description>&lt;P&gt;Thanks for your reply and help. Yes, I will next time attach the script as text. I manage to workaround the model builder. I haven't tried it just as plain python script, but I will.&amp;nbsp; I am attaching the model I was using. I was creating a clean table with the same attributes from the table generated in the zonal statistics (including the new attribute, name of the raster). And I was appending each calculation to that table.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Apr 2021 07:16:23 GMT</pubDate>
    <dc:creator>MonicaRuano1</dc:creator>
    <dc:date>2021-04-12T07:16:23Z</dc:date>
    <item>
      <title>how to parse the raster name into a table in model builder or python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-parse-the-raster-name-into-a-table-in-model/m-p/1040218#M60543</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help to finish a task.&lt;/P&gt;&lt;P&gt;I am trying to use model builder to simplify a task with Zonal Statistics as Table. I have temperature and precipitation *. bil files in their folders.&amp;nbsp; Problem with model builder is that I have to generate two toolboxes. One for temperature and one for precipitation. Now I am trying with temperature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the iterate rasters to read the rasters, but I wanted to use the Name to fill a new field that I want to create in the table created with the Zonal Statistics. But I don't manage to do it.&amp;nbsp; I am using a polygon of municipalities as feature zone data and the rasters as Input value display.&lt;/P&gt;&lt;P&gt;Can somebody help me with tips? I will appreciate it. I would like to have a table&amp;nbsp; like this.&amp;nbsp; By now I am able to get a table by dataset (one for temperature (tm), one for precipitation (rr)), but no raster name yet and not a merge table either.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;raster_name&lt;/TD&gt;&lt;TD&gt;Municipality_number&lt;/TD&gt;&lt;TD&gt;Altitude&lt;/TD&gt;&lt;TD&gt;rr&lt;/TD&gt;&lt;TD&gt;tm&lt;/TD&gt;&lt;TD&gt;sd&lt;/TD&gt;&lt;TD&gt;sdfsw&lt;/TD&gt;&lt;TD&gt;fsw&lt;/TD&gt;&lt;TD&gt;swe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attaching the model builder example also.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was also trying some python, but I don't manage to add the name to the table either on Python. I was generating a listraster but I am new to python and do now how to add the rasters name in the table.&amp;nbsp; Here is the python example also attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-parse-the-raster-name-into-a-table-in-model/m-p/1040218#M60543</guid>
      <dc:creator>MonicaRuano1</dc:creator>
      <dc:date>2021-03-24T15:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to parse the raster name into a table in model builder or python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-parse-the-raster-name-into-a-table-in-model/m-p/1040321#M60544</link>
      <description>&lt;P&gt;I've not really checked your script for errors but I guess it works (also if you want to share code in the future, add it as code formatted text - screenshots of code are awful to deal with)&lt;/P&gt;&lt;P&gt;If it works, you're creating a table in each for loop - so add a new field (TEXT) to the table&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-field.htm" target="_blank"&gt;Add Field (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;then calculate field for all rows in the table (as you may have more than one zone I guess) -&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_blank"&gt;Calculate Field (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you can use the inRaster&amp;nbsp; variable as it's a string of your raster name (I think?) i.e. expression = inRaster&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 18:57:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-parse-the-raster-name-into-a-table-in-model/m-p/1040321#M60544</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-03-24T18:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to parse the raster name into a table in model builder or python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-parse-the-raster-name-into-a-table-in-model/m-p/1045827#M60737</link>
      <description>&lt;P&gt;Thanks for your reply and help. Yes, I will next time attach the script as text. I manage to workaround the model builder. I haven't tried it just as plain python script, but I will.&amp;nbsp; I am attaching the model I was using. I was creating a clean table with the same attributes from the table generated in the zonal statistics (including the new attribute, name of the raster). And I was appending each calculation to that table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 07:16:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-parse-the-raster-name-into-a-table-in-model/m-p/1045827#M60737</guid>
      <dc:creator>MonicaRuano1</dc:creator>
      <dc:date>2021-04-12T07:16:23Z</dc:date>
    </item>
  </channel>
</rss>

