<?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 identify and group polygons highly overlapped with one another within the same vector layer? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279072#M26830</link>
    <description>&lt;P&gt;Hi Johannes, thanks for your reply. But in my case, these thoudsands of polygons are all in one layer rather than two layers. Any further suggestion?&lt;/P&gt;</description>
    <pubDate>Sun, 16 Apr 2023 05:59:08 GMT</pubDate>
    <dc:creator>BeichenTian</dc:creator>
    <dc:date>2023-04-16T05:59:08Z</dc:date>
    <item>
      <title>How to identify and group polygons highly overlapped with one another within the same vector layer?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279013#M26826</link>
      <description>&lt;DIV class=""&gt;&lt;P&gt;I have a vector layer containing thoudsands of polygons. Some of these polygons are (highly) overlapped with one another.&lt;/P&gt;&lt;P&gt;I have two purposes:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;identify polygons that are highly overlapped (spatially overlapped and areas are quite similar/ the same) ;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;group these highly overlapped polygons (assign each group a common value in a column to indicate such group relationship.&lt;/P&gt;&lt;P&gt;How may I implement these in ArcMap/ Arcpy/ geopandas? Any hints are welcome!&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 15 Apr 2023 08:02:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279013#M26826</guid>
      <dc:creator>BeichenTian</dc:creator>
      <dc:date>2023-04-15T08:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify and group polygons highly overlapped with one another within the same vector layer?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279014#M26827</link>
      <description>&lt;P&gt;I am assuming non-geometric polygonal shapes (eg not all squares, circles, etc).&lt;/P&gt;&lt;P&gt;First, give&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/find-identical.htm" target="_blank"&gt;Find Identical (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;a try on the Shape field, using a the xy_tolerance set to some reasonable acceptable distance for variation in the vertices potential differences.&amp;nbsp; This may work in some cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that doesn't, try simple tests like symbolizin your data on the shape_area, then shape_length.&amp;nbsp; If a spatial pattern appears, then you can move on to a refinement step.&lt;/P&gt;&lt;P&gt;If&amp;nbsp; the simple test doesn't yield any pattern, add a column to you table and calculate &lt;STRONG&gt;shape_area/shape_length&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;this will give you another shape parameter to guage geometry similarity beyond just area or perimeter alone.&amp;nbsp; Does it reveal any&amp;nbsp; spatial pattern?&lt;/P&gt;&lt;P&gt;Refinement, is to denote location.&amp;nbsp; Export your featureclass using&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/feature-to-point.htm" target="_blank"&gt;Feature To Point (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;to produce a point featureclass of the geometry centroids.&lt;/P&gt;&lt;P&gt;Most people don't have the spatial statistics toolset which would be useful for clustering analysis to provide the next step in refinement&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-statistics/an-overview-of-the-mapping-clusters-toolset.htm" target="_blank"&gt;An overview of the Mapping Clusters toolset—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;so you can use&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/cartography/aggregate-points.htm" target="_blank"&gt;Aggregate Points (Cartography)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;to form polygons from any apparent centroid clusters..&lt;/P&gt;&lt;P&gt;If there is a spatial pattern, then you can use those clusters in a spatial join to investigate what the underlying original polygons are like.&amp;nbsp; If each cluster contained similar/identical polygons, then you can use that for a your final classification.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2023 09:40:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279014#M26827</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-04-15T09:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify and group polygons highly overlapped with one another within the same vector layer?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279050#M26829</link>
      <description>&lt;P&gt;With tools:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Intersect the both feature classes&lt;/LI&gt;&lt;LI&gt;use Join Field to copy the !Shape_Area! fields from the fcs into the intersection&lt;/LI&gt;&lt;LI&gt;use Calculate Field to calculate how much the intersection covers the respective features&lt;OL&gt;&lt;LI&gt;Percentage_1 = Area_Intersection / Area_FC1 * 100&lt;/LI&gt;&lt;LI&gt;Percentage_2 = Area_Intersection / Area_FC2 * 100&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Select Layer By Attribute to select those features where both percentages are above a certain threshold, eg 90%&lt;/LI&gt;&lt;LI&gt;export those features. The OBJECTID is the GroupID, the two FID fields are the OBJECTIDs of the features that are part of the group. You can use Join Field to get the GroupID Into the original feature classes&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example (yellow polygons labeled with yellow OBJECTIDs, black outlined Polygons labeled with black OBJECTIDs, groups not symbolized but labeled with red OBJECTIDs. Polygons without group don't have enough overlap.)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1681599061761.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68104i87D5B5D7622925CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1681599061761.png" alt="JohannesLindner_0-1681599061761.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can do the same with arcpy, but the field mappings are a hassle. It's easier using Cursors:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fc_1 = "TestPolygons"
fc_2 = "TestPolygons_1"
out_folder = "memory"
out_name = "Groups"

# read fcs as {oid: geometry}
geo_1 = dict([row for row in arcpy.da.SearchCursor(fc_1, ["OID@", "SHAPE@"])])
geo_2 = dict([row for row in arcpy.da.SearchCursor(fc_2, ["OID@", "SHAPE@"])])

# intersect the fcs and read the result as [ [ geometry, fid_1, fid_2 ] ]
intersection = arcpy.analysis.Intersect([fc_1, fc_2], "memory/intersect", "ONLY_FID")
fid_fields = [f.name for f in arcpy.ListFields(intersection) if f.type=="Integer"]
intersect = [row for row in arcpy.da.SearchCursor(intersection, ["SHAPE@"] + fid_fields)]

# create output
out_table = arcpy.management.CreateFeatureclass(out_folder, out_name, "POLYGON", spatial_reference=fc_1)
for fid in fid_fields:
    arcpy.management.AddField(out_table, fid, "LONG")
    
with arcpy.da.InsertCursor(out_table, ["SHAPE@"] + fid_fields) as cursor:
    for shp, fid_1, fid_2 in intersect:
        # get the corresponding original polygons
        shp_1 = geo_1[fid_1]
        shp_2 = geo_2[fid_2]
        # if they are sufficiently same-ish, write the fids into the output table
        if (shp.area / shp_1.area &amp;gt; 0.9) and (shp.area / shp_2.area &amp;gt; 0.9):
            cursor.insertRow([shp, fid_1, fid_2])&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 15 Apr 2023 23:11:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279050#M26829</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-04-15T23:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify and group polygons highly overlapped with one another within the same vector layer?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279072#M26830</link>
      <description>&lt;P&gt;Hi Johannes, thanks for your reply. But in my case, these thoudsands of polygons are all in one layer rather than two layers. Any further suggestion?&lt;/P&gt;</description>
      <pubDate>Sun, 16 Apr 2023 05:59:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279072#M26830</guid>
      <dc:creator>BeichenTian</dc:creator>
      <dc:date>2023-04-16T05:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify and group polygons highly overlapped with one another within the same vector layer?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279075#M26831</link>
      <description>&lt;P&gt;Ah OK. You have to do just a little bit more.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Intersect the fc with itself&lt;/LI&gt;&lt;LI&gt;delete all features of the intersection where FID1 = FID2&lt;/LI&gt;&lt;LI&gt;use Join Field to copy the Shape_Area field into the intersection. Do this twice (join with FID1 and with FID2).&lt;/LI&gt;&lt;LI&gt;use Calculate Field to calculate how much the intersection covers the respective features&lt;OL&gt;&lt;LI&gt;Percentage_1 = Area_Intersection / Area_1 * 100&lt;/LI&gt;&lt;LI&gt;Percentage_2 = Area_Intersection / Area_2 * 100&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Select Layer By Attribute to select those features where both percentages are above a certain threshold, eg 90%&lt;/LI&gt;&lt;LI&gt;export those features. The OBJECTID is the GroupID, the two FID fields are the OBJECTIDs of the features that are part of the group. You can use Join Field to get the GroupID Into the original feature class&lt;/LI&gt;&lt;LI&gt;use Delete Identical on the exported fc with the Shape field&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fc = "TestPolygons"
out_folder = "memory"
out_name = "Groups"

# read fc as {oid: geometry}
geo = dict([row for row in arcpy.da.SearchCursor(fc, ["OID@", "SHAPE@"])])

# intersect the fc with itself and read the result as [ [ geometry, fid_1, fid_2 ] ]
intersection = arcpy.analysis.Intersect([fc, fc], "memory/intersect", "ONLY_FID")
fid_fields = [f.name for f in arcpy.ListFields(intersection) if f.type=="Integer"]
intersect = [row for row in arcpy.da.SearchCursor(intersection, ["SHAPE@"] + fid_fields)]

# create output
out_table = arcpy.management.CreateFeatureclass(out_folder, out_name, "POLYGON", spatial_reference=fc)
arcpy.management.AddField(out_table, "FID_1", "LONG")
arcpy.management.AddField(out_table, "FID_2", "LONG")

    
with arcpy.da.InsertCursor(out_table, ["SHAPE@", "FID_1", "FID_2"]) as cursor:
    for shp, fid_1, fid_2 in intersect:
        # skip if fids are the same
        if fid_1 == fid_2:
            continue
        # get the corresponding original polygons
        shp_1 = geo[fid_1]
        shp_2 = geo[fid_2]
        # if they are sufficiently same-ish, write the fids into the output table
        if (shp.area / shp_1.area &amp;gt; 0.9) and (shp.area / shp_2.area &amp;gt; 0.9):
            cursor.insertRow([shp, fid_1, fid_2])
arcpy.management.DeleteIdentical(out_table, "Shape")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1681634269527.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68118i15FA104B879B553A/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1681634269527.png" alt="JohannesLindner_0-1681634269527.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Apr 2023 08:37:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1279075#M26831</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-04-16T08:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify and group polygons highly overlapped with one another within the same vector layer?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1281697#M26841</link>
      <description>&lt;P&gt;Hi Johannes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Great point! We adopted your strategy and did make some progress. But we also found out that some identical polygons (polygons with exactly the same shape and area overlapping together) somehow did not get grouped at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For instance, the three polygons with highlighted yellow color in pic 1 (南山区-2021-0588号, 南山区-2020-0268号,南山区-2019-0885号) overlapped with each other 100%. They additionally overlapped with some smaller polygons (see pic 2). However, the tool "intersect" only returned intersected results of these three polygons with those smaller polygons, rather than additionally returning intersected results among the three polygons themselves. Any hints to solve this? Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pic 1: the three polygons overlapping each other 100% but not grouped into a family by the intersect tool&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="identical_polygons not grouped.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68851iAB32304D619A6131/image-size/medium?v=v2&amp;amp;px=400" role="button" title="identical_polygons not grouped.png" alt="identical_polygons not grouped.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Pic 2: Take polygon 南山区-2019-0885号 for instance, the intersect result only returned its intersected areas with small polygons rather than returning its intersected results with 南山区-2021-0588号 and 南山区-2020-0268号 as well.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="identical_polygons not grouped2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68852i1D4466974683E8FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="identical_polygons not grouped2.png" alt="identical_polygons not grouped2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2023 15:22:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-identify-and-group-polygons-highly/m-p/1281697#M26841</guid>
      <dc:creator>BeichenTian</dc:creator>
      <dc:date>2023-04-23T15:22:42Z</dc:date>
    </item>
  </channel>
</rss>

