<?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 Python scripts for Fish data intersecting ICES Blocks in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-scripts-for-fish-data-intersecting-ices/m-p/196860#M15098</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, I am trying to create a script that automates a task for me&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I basically have two polygon shapefiles that contains data on spawning and nursing fish locations respectively within UK waters. Lets call them spawning.shp and nursing.shp. There is an attribute field that contains the species (Cod, Hake Plaice etc) which is what I want to extract for later.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is then a shapefile which contains ICES Blocks within UK waters, which are basically large polygons in a kind of grid across UK waters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically what I want to achieve is two output shapefiles that contains all the ICES Blocks in one attribute field, and then the other attribute fields containing all the fish species within the spawning and nursing shapefiles, with the data in the fields simply being a "Yes" or a "No", based on whether that fish species is present within that Block (one shapefile concerning spawning species, one concerning nursing species.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm fairly sure this should be quite simple to do but I am new to python/currently useless at it, so any help would be fantastic&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Apr 2014 08:43:48 GMT</pubDate>
    <dc:creator>IanCharlton</dc:creator>
    <dc:date>2014-04-28T08:43:48Z</dc:date>
    <item>
      <title>Python scripts for Fish data intersecting ICES Blocks</title>
      <link>https://community.esri.com/t5/python-questions/python-scripts-for-fish-data-intersecting-ices/m-p/196860#M15098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, I am trying to create a script that automates a task for me&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I basically have two polygon shapefiles that contains data on spawning and nursing fish locations respectively within UK waters. Lets call them spawning.shp and nursing.shp. There is an attribute field that contains the species (Cod, Hake Plaice etc) which is what I want to extract for later.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is then a shapefile which contains ICES Blocks within UK waters, which are basically large polygons in a kind of grid across UK waters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically what I want to achieve is two output shapefiles that contains all the ICES Blocks in one attribute field, and then the other attribute fields containing all the fish species within the spawning and nursing shapefiles, with the data in the fields simply being a "Yes" or a "No", based on whether that fish species is present within that Block (one shapefile concerning spawning species, one concerning nursing species.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm fairly sure this should be quite simple to do but I am new to python/currently useless at it, so any help would be fantastic&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 08:43:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripts-for-fish-data-intersecting-ices/m-p/196860#M15098</guid>
      <dc:creator>IanCharlton</dc:creator>
      <dc:date>2014-04-28T08:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Python scripts for Fish data intersecting ICES Blocks</title>
      <link>https://community.esri.com/t5/python-questions/python-scripts-for-fish-data-intersecting-ices/m-p/196861#M15099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know how your species shapefile tables are constructed,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but an ineger field for each species would be handy, calculated to 1 for presence.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use a loop with Add field, if you have to add them:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
fields = ["Cod", "Hake" "Plaice", "Wanda"]
for f in fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management (in_table, f, "SHORT")&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Now use an update cursor to update each presence species&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use Union or Identity with the Blocks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so you have all the bolcks broken up by the presence areas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dissolve the overlay output on the bolck ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;summing the values in each species field, so that,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for example,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if SUM_Cod is &amp;gt; 0, then cod is present.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:50:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripts-for-fish-data-intersecting-ices/m-p/196861#M15099</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2021-12-11T09:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python scripts for Fish data intersecting ICES Blocks</title>
      <link>https://community.esri.com/t5/python-questions/python-scripts-for-fish-data-intersecting-ices/m-p/196862#M15100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe a &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//0017000000n8000000"&gt;pivot table&lt;/A&gt;&lt;SPAN&gt; would be useful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 13:11:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripts-for-fish-data-intersecting-ices/m-p/196862#M15100</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2014-04-28T13:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python scripts for Fish data intersecting ICES Blocks</title>
      <link>https://community.esri.com/t5/python-questions/python-scripts-for-fish-data-intersecting-ices/m-p/196863#M15101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think before you start scripting the process out, it may be useful to figure out the geospatial analysis process first.&amp;nbsp; If I'm understanding what you want for an output, a spatial join may be something to look into.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Essentially, you'd spatially joining each of the two layers, nursing.shp and spawning.shp, to the ICES Blocks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another option could be a Select By Location.&amp;nbsp; Select all the ICES Blocks that intersect each of your shp files, and assign a value to a field of your choice based on that selection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Usually the spatial join would be the preferable way to go since is "costs" less as far as processing goes that a Select by Location.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2014 00:04:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripts-for-fish-data-intersecting-ices/m-p/196863#M15101</guid>
      <dc:creator>MattEiben</dc:creator>
      <dc:date>2014-04-30T00:04:52Z</dc:date>
    </item>
  </channel>
</rss>

