<?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: Get features attribute from one shape to another in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/get-features-attribute-from-one-shape-to-another/m-p/465232#M15644</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.env.overwriteOutput = True

bigPolygonLayer = r"C:\tmp\Test.gdb\BigPolygons"
smallPolygonLayer = r"C:\tmp\Test.gdb\SmallPolygons"
idField = "YourIDField"

#add new field to target feature class if not exists:
fieldList = arcpy.ListFields(bigPolygonLayer)
fieldNameList = []
for field in fieldList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldNameList.append(field.name)
if not idField in fieldNameList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(bigPolygonLayer, idField, "TEXT","","",1023) #you can adjust field length

#loop throug big polygons
bigPolyUC = arcpy.UpdateCursor(bigPolygonLayer)
for bigPolyRow in bigPolyUC:
&amp;nbsp;&amp;nbsp;&amp;nbsp; bigPolyGeom = bigPolyRow.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; concatIDLst =[]

&amp;nbsp;&amp;nbsp;&amp;nbsp; #loop through all small polygons, take ID values if small polygon OVERLAPS the big ...
&amp;nbsp;&amp;nbsp;&amp;nbsp; #and add to concat string; (You can change relation to CONTAINS to restrict results)
&amp;nbsp;&amp;nbsp;&amp;nbsp; smallPolySC = arcpy.SearchCursor(smallPolygonLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for smallPolyRow in smallPolySC:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; smallPolyGeom = smallPolyRow.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if bigPolyGeom.overlaps(smallPolyGeom):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; concatIDLst.append(str(smallPolyRow.getValue(idField)))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; concatID = "".join(concatIDLst) #between "" you can add any ID separator: space, comma, etc.

&amp;nbsp;&amp;nbsp;&amp;nbsp; bigPolyRow.setValue(idField, concatID)
&amp;nbsp;&amp;nbsp;&amp;nbsp; bigPolyUC.updateRow(bigPolyRow)

del smallPolySC, smallPolyRow, bigPolyUC, bigPolyRow, bigPolyGeom&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For more info how OVERLAPS work check &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Geometry/000v00000095000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;Geometry class&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:38:53 GMT</pubDate>
    <dc:creator>MarcinGasior</dc:creator>
    <dc:date>2021-12-11T20:38:53Z</dc:date>
    <item>
      <title>Get features attribute from one shape to another</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-features-attribute-from-one-shape-to-another/m-p/465231#M15643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have two shapefiles : a first one with big polygones and a second one with smaller polygones.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to create a text field in the first shape that would concatenate the ID fields of all the small polygones of the second shape that are included (at least partially) in the polygone of the first shape.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea how I could do that ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Manu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 13:21:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-features-attribute-from-one-shape-to-another/m-p/465231#M15643</guid>
      <dc:creator>ManuHarchies</dc:creator>
      <dc:date>2012-04-18T13:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get features attribute from one shape to another</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-features-attribute-from-one-shape-to-another/m-p/465232#M15644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.env.overwriteOutput = True

bigPolygonLayer = r"C:\tmp\Test.gdb\BigPolygons"
smallPolygonLayer = r"C:\tmp\Test.gdb\SmallPolygons"
idField = "YourIDField"

#add new field to target feature class if not exists:
fieldList = arcpy.ListFields(bigPolygonLayer)
fieldNameList = []
for field in fieldList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldNameList.append(field.name)
if not idField in fieldNameList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(bigPolygonLayer, idField, "TEXT","","",1023) #you can adjust field length

#loop throug big polygons
bigPolyUC = arcpy.UpdateCursor(bigPolygonLayer)
for bigPolyRow in bigPolyUC:
&amp;nbsp;&amp;nbsp;&amp;nbsp; bigPolyGeom = bigPolyRow.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; concatIDLst =[]

&amp;nbsp;&amp;nbsp;&amp;nbsp; #loop through all small polygons, take ID values if small polygon OVERLAPS the big ...
&amp;nbsp;&amp;nbsp;&amp;nbsp; #and add to concat string; (You can change relation to CONTAINS to restrict results)
&amp;nbsp;&amp;nbsp;&amp;nbsp; smallPolySC = arcpy.SearchCursor(smallPolygonLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for smallPolyRow in smallPolySC:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; smallPolyGeom = smallPolyRow.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if bigPolyGeom.overlaps(smallPolyGeom):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; concatIDLst.append(str(smallPolyRow.getValue(idField)))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; concatID = "".join(concatIDLst) #between "" you can add any ID separator: space, comma, etc.

&amp;nbsp;&amp;nbsp;&amp;nbsp; bigPolyRow.setValue(idField, concatID)
&amp;nbsp;&amp;nbsp;&amp;nbsp; bigPolyUC.updateRow(bigPolyRow)

del smallPolySC, smallPolyRow, bigPolyUC, bigPolyRow, bigPolyGeom&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For more info how OVERLAPS work check &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Geometry/000v00000095000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;Geometry class&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:38:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-features-attribute-from-one-shape-to-another/m-p/465232#M15644</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2021-12-11T20:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get features attribute from one shape to another</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/get-features-attribute-from-one-shape-to-another/m-p/465233#M15645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;I would like to create a text field in the first shape that would concatenate the ID fields of all the small polygones of the second shape that are included (at least partially) in the polygone of the first shape.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use Spatial Join tool with INTERSECT option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Field Mapping control of the Spatial Join add a new output field of type TEXT with the merge rule of Join.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 19:38:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/get-features-attribute-from-one-shape-to-another/m-p/465233#M15645</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2012-04-20T19:38:55Z</dc:date>
    </item>
  </channel>
</rss>

