<?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: Batch processing of polygon to raster with multliple fields in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/batch-processing-of-polygon-to-raster-with/m-p/70461#M5764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake caught it, Esteban.... for future reference &lt;A href="https://community.esri.com/migration-blogpost/55181"&gt;Code Formatting... the basics++&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 May 2016 17:57:20 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2016-05-05T17:57:20Z</dc:date>
    <item>
      <title>Batch processing of polygon to raster with multliple fields</title>
      <link>https://community.esri.com/t5/python-questions/batch-processing-of-polygon-to-raster-with/m-p/70459#M5762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-family: verdana, arial, helvetica, sans-serif; font-size: 14px;"&gt;I am attempting to create a script that will use the polygon to raster conversion in a batch processing function that creates multiple rasters based on different fields specified. I am wanting to do this for multiple feature classes within a folder. So far I have been able to get it to run for only one of the desired feature classes but not both.( There are two within the folder). Here is my script.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from arcpy import env &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Set environment settings &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; env.workspace = r"E:\GISC605GISDevelopment\Python Project\RivCounty"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Set local variables &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; valField = ["TOTAL_PRO","OWN","COLLEGE_ED","Foreign","Per_INC2","TOTAL_25MI"] &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outRaster = r"E:\GISC605GISDevelopment\Python Project\RivCounty\Group" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #List features &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcList = arcpy.ListFeatureClasses() &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fcList &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp; for fc in fcList: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in valField: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5763; font-size: 14px; font-family: monospace, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.PolygonToRaster_conversion(fc, field, outRaster+str(valField.index(field))+".img")&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2016 17:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-processing-of-polygon-to-raster-with/m-p/70459#M5762</guid>
      <dc:creator>EstebanBarbosa</dc:creator>
      <dc:date>2016-05-05T17:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Batch processing of polygon to raster with multliple fields</title>
      <link>https://community.esri.com/t5/python-questions/batch-processing-of-polygon-to-raster-with/m-p/70460#M5763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Esteban,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe you are overwriting the first outputs with your for loop.&amp;nbsp; Try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;x = 1
for fc in fcList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in valField:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.PolygonToRaster_conversion(fc, field, outRaster+str(x)+"_"+str(valField.index(field))+".img")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:42:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-processing-of-polygon-to-raster-with/m-p/70460#M5763</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-10T22:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Batch processing of polygon to raster with multliple fields</title>
      <link>https://community.esri.com/t5/python-questions/batch-processing-of-polygon-to-raster-with/m-p/70461#M5764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake caught it, Esteban.... for future reference &lt;A href="https://community.esri.com/migration-blogpost/55181"&gt;Code Formatting... the basics++&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2016 17:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-processing-of-polygon-to-raster-with/m-p/70461#M5764</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-05T17:57:20Z</dc:date>
    </item>
  </channel>
</rss>

