<?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: Shapefile Automation in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/shapefile-automation/m-p/402273#M4400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The best way to get an answer to this would be to post your Shapefile to this forum thread inside a ZIP file.&amp;nbsp; In general, you'll need a Python script that will select record by attribute based on species value, then export a shape file based on the selected records, then convert the output shape file to a raster file.&amp;nbsp; This would be automated for each of the species.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What format are you expecting for your raster images (e.g., TIFF, GRID, JPG)?&amp;nbsp; Which version of the ArcGIS software are you using?&amp;nbsp; Which version of Python do you have installed?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Mar 2014 00:42:43 GMT</pubDate>
    <dc:creator>WilliamCraft</dc:creator>
    <dc:date>2014-03-05T00:42:43Z</dc:date>
    <item>
      <title>Shapefile Automation</title>
      <link>https://community.esri.com/t5/mapping-questions/shapefile-automation/m-p/402272#M4399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello. Firstly, please accept my apologies if I have posted this in the wrong sub-forum...I'm not sure where the best place is to post this sort of question! Anyway, here is my problem (in two parts) and I'm really hoping someone can help me out automating it...to do this manually will take such a long time, so any help would be fantastic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working on a project regarding lizards in North America. I currently have a shapefile with all the species present on the continent. What I would like to do is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Take the range of each species in the 'master' shapefile and split this into an individual shapefile for each species. Each shapefile and associated files would need to go into a separate folder in ascending order (so the first species on my list &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Abriona aurita&lt;/SPAN&gt;&lt;SPAN&gt; would go into&amp;nbsp; 'Folder 1' then &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Abriona bogerti&lt;/SPAN&gt;&lt;SPAN&gt; would go in 'Folder 2' etc). My list of lizard species in North America currently stands at 467 so you can probably see why I wish to automate this!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Once I have each individual species as a shapefile, I need to convert this into a raster using ArcGIS's built in Polygon -&amp;gt; Raster conversion tool. Again, would it be possible to automate this job as well by pointing to each folder and asking the software to dump a raster image in there as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks in advance for your help. Any assistance would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT- An alternative method, I suppose, would cut out stage 1 to some extent and just create a raster from each polygon in the master shapefile. I have no idea how to do this, however!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 08:41:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/shapefile-automation/m-p/402272#M4399</guid>
      <dc:creator>SimonTarr</dc:creator>
      <dc:date>2014-02-24T08:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Shapefile Automation</title>
      <link>https://community.esri.com/t5/mapping-questions/shapefile-automation/m-p/402273#M4400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The best way to get an answer to this would be to post your Shapefile to this forum thread inside a ZIP file.&amp;nbsp; In general, you'll need a Python script that will select record by attribute based on species value, then export a shape file based on the selected records, then convert the output shape file to a raster file.&amp;nbsp; This would be automated for each of the species.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What format are you expecting for your raster images (e.g., TIFF, GRID, JPG)?&amp;nbsp; Which version of the ArcGIS software are you using?&amp;nbsp; Which version of Python do you have installed?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 00:42:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/shapefile-automation/m-p/402273#M4400</guid>
      <dc:creator>WilliamCraft</dc:creator>
      <dc:date>2014-03-05T00:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Shapefile Automation</title>
      <link>https://community.esri.com/t5/mapping-questions/shapefile-automation/m-p/402274#M4401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a code sample for what you may be looking for:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[PHP]import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import os&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;unique= []&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input = r"C:\Users\Username\Lizards\TestData.gdb\Lizards"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cursor = arcpy.SearchCursor(input, '', '','LizardType')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if row.LizardType not in unique:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unique.append(row.LizardType)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print unique&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for x in unique:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectionvalue = str(x)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; query = '"LizardType" = ' + "'" + selectionvalue + "'"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print query&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("Lizards", "NEW_SELECTION", query)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dissolveout = os.path.join("C:\Users\Username\Lizards", x, "test" + str(int(x)) + ".shp")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dissolveoutraster = os.path.join("C:\Users\Username\Lizards", x, "raster" + str(int(x)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management("Lizards", dissolveout)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.PolygonToRaster_conversion(dissolveout, "CellValue", dissolveoutraster, "CELL_CENTER", "CellValue", "")[/PHP]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 15:58:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/shapefile-automation/m-p/402274#M4401</guid>
      <dc:creator>KaraManseau1</dc:creator>
      <dc:date>2014-03-18T15:58:03Z</dc:date>
    </item>
  </channel>
</rss>

