<?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 features with identical geometry WKT representation not equal in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603971#M47204</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The results of arcpy.FindIdentical() with "Shape" selected as field option show two features in my dataset to be identical in geometry, yet when I run a search cursor through it, and append the WKT of the two geometries into a list, these two strings are not equal (they even have different lengths). I thought the WKT was a representation of the geometry in string form. The JSON representation is also unequal.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Jun 2013 15:07:03 GMT</pubDate>
    <dc:creator>JamieKass</dc:creator>
    <dc:date>2013-06-11T15:07:03Z</dc:date>
    <item>
      <title>features with identical geometry WKT representation not equal</title>
      <link>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603971#M47204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The results of arcpy.FindIdentical() with "Shape" selected as field option show two features in my dataset to be identical in geometry, yet when I run a search cursor through it, and append the WKT of the two geometries into a list, these two strings are not equal (they even have different lengths). I thought the WKT was a representation of the geometry in string form. The JSON representation is also unequal.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 15:07:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603971#M47204</guid>
      <dc:creator>JamieKass</dc:creator>
      <dc:date>2013-06-11T15:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: features with identical geometry WKT representation not equal</title>
      <link>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603972#M47205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't have any experence with teh WKT values, but how different are the values (you mention length)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have had issues with geometries that include "true curve" features, that should be identical, but in fact have ever so slightly different areas/perimeters/centroid values - I am talking like a difference of 0.00001 map units. But enough to throw my script logic out of whack.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 15:19:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603972#M47205</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2013-06-11T15:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: features with identical geometry WKT representation not equal</title>
      <link>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603973#M47206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The string lengths of the WKT values differ, and although the differences are slight, any difference renders them unequal. The FindIdentical tool obviously has some internal geometry tolerance that allows it to overlook these slight differences, and I wonder if we can simulate this in some way by altering the WKT values. I am trying to explore geometries this way because running FindIdentical on large features (&amp;gt;100,000) often crashes or takes forever to run.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 16:03:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603973#M47206</guid>
      <dc:creator>JamieKass</dc:creator>
      <dc:date>2013-06-11T16:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: features with identical geometry WKT representation not equal</title>
      <link>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603974#M47207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I feel your pain: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/49557-True-Curves-True-Evil"&gt;http://forums.arcgis.com/threads/49557-True-Curves-True-Evil&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=983&amp;amp;t=292699"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=983&amp;amp;t=292699&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 16:11:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603974#M47207</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2013-06-11T16:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: features with identical geometry WKT representation not equal</title>
      <link>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603975#M47208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Assuming your geometries have some true curves in them, I bet that if you convert your FC to a shapefile, then look at the WKT values, they "should" then be ==.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;About a year ago, I had been in contact with ESRI about this issue (true curve geometry being slightly off).... didn't go anywhere though... ESRI commited to curve geometry. No plans to have an envr setting to keep the GDB geometry densified (which seems to prevent these minute geometry property differences).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 17:28:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603975#M47208</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2013-06-11T17:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: features with identical geometry WKT representation not equal</title>
      <link>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603976#M47209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, they are still different, although the string length difference has changed from 4 to 1. (???) I am running this on a buffer product, and likely these true curves are the culprit. My question is: how does FindIdentical do it? I just need to replicate that without the bells and whistles that slow it down so much. All I'm really interested in is which shapes are identical to each other after a union operation on buffers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 17:50:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603976#M47209</guid>
      <dc:creator>JamieKass</dc:creator>
      <dc:date>2013-06-11T17:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: features with identical geometry WKT representation not equal</title>
      <link>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603977#M47210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure, but I bet FindIdentical simply rounds the values - maybe with the xy tolerance value (or some derivation of it) of the FC?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;All I'm really interested in is which shapes are identical to each other after a union operation on buffers.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume to figure out overlaps? I do this too... I just round the values of the centroid x/y coordinates and the polygon area. If it helps give you ideas:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#Flatten this puppy!
shatteredFC = fgdbPath + "\\shattered"
arcpy.Union_analysis(dissolveFC, shatteredFC, "ALL", "1 FEET", "GAPS"); showGpMessage()
singlePartFC = fgdbPath + "\\single_part"
arcpy.MultipartToSinglepart_management(shatteredFC, singlePartFC); showGpMessage()
searchRows = arcpy.da.SearchCursor(singlePartFC, ["SHAPE@","*"])
polyIdDict = {}
polyIdValue = 1
decimalTolerance = 2
for searchRow in searchRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; shapeFieldValue = searchRow[searchRows.fields.index("SHAPE@")]
&amp;nbsp;&amp;nbsp;&amp;nbsp; xCentroidValue = round(shapeFieldValue.centroid.X, decimalTolerance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; yCentroidValue = round(shapeFieldValue.centroid.Y, decimalTolerance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; areaValue = round(shapeFieldValue.area, decimalTolerance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; axyValue = (xCentroidValue,yCentroidValue,areaValue)
&amp;nbsp;&amp;nbsp;&amp;nbsp; catagoryNameValue = searchRow[searchRows.fields.index("CATEGORY")]
&amp;nbsp;&amp;nbsp;&amp;nbsp; releaseYearValue = searchRow[searchRows.fields.index("RELEASE_YR")]
&amp;nbsp;&amp;nbsp;&amp;nbsp; retentionPctValue = searchRow[searchRows.fields.index("RETENTION_PCNT")]
&amp;nbsp;&amp;nbsp;&amp;nbsp; forestedFlagValue = searchRow[searchRows.fields.index("FORESTED")]
&amp;nbsp;&amp;nbsp;&amp;nbsp; if axyValue not in polyIdDict:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdDict[axyValue] = polyIdValue, [catagoryNameValue], [releaseYearValue],[retentionPctValue],[forestedFlagValue]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdValue = polyIdValue + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdDict[axyValue][1].append(catagoryNameValue)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdDict[axyValue][2].append(releaseYearValue)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdDict[axyValue][3].append(retentionPctValue)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdDict[axyValue][4].append(forestedFlagValue)
del searchRow, searchRows
#Sort the thing the way we want it
for axyValue in polyIdDict:
&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdDict[axyValue][1].sort() #catagory name
&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdDict[axyValue][2].sort(reverse=True) #release year
&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdDict[axyValue][3].sort(reverse=True) #retention percent
&amp;nbsp;&amp;nbsp;&amp;nbsp; polyIdDict[axyValue][4].sort() #forested
arcpy.AddField_management(singlePartFC, "POLY_ID", "LONG"); showGpMessage()&amp;nbsp; 
arcpy.AddField_management(singlePartFC, "LCL_RSN", "TEXT", "", "", "150"); showGpMessage()
arcpy.AddField_management(singlePartFC, "RELEASE_YR_MAX", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "RETENTION_PCNT_MAX", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "FORESTED_MAX", "TEXT", "", "", "1"); showGpMessage()
arcpy.AddField_management(singlePartFC, "LCL_RP_FLG", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "LCL_UP_FLG", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "LCL_US_FLG", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "LCL_WT_FLG", "SHORT"); showGpMessage()
updateRows = arcpy.da.UpdateCursor(singlePartFC, ["SHAPE@","*"])
for updateRow in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; shapeFieldValue = updateRow[updateRows.fields.index("SHAPE@")]
&amp;nbsp;&amp;nbsp;&amp;nbsp; xCentroidValue = round(shapeFieldValue.centroid.X, decimalTolerance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; yCentroidValue = round(shapeFieldValue.centroid.Y, decimalTolerance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; areaValue = round(shapeFieldValue.area, decimalTolerance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; axyValue = (xCentroidValue,yCentroidValue,areaValue)
&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[updateRows.fields.index("POLY_ID")] = polyIdDict[axyValue][0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[updateRows.fields.index("LCL_RSN")] = ",".join(i for i in sorted(set(polyIdDict[axyValue][1])))
&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[updateRows.fields.index("RELEASE_YR_MAX")] = polyIdDict[axyValue][2][0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[updateRows.fields.index("RETENTION_PCNT_MAX")] = polyIdDict[axyValue][3][0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[updateRows.fields.index("FORESTED_MAX")] = polyIdDict[axyValue][4][0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; if "RIPARIAN_AREA" in polyIdDict[axyValue][1] or "RMZ" in polyIdDict[axyValue][1]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[updateRows.fields.index("LCL_RP_FLG")] = 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; if "WETLAND" in polyIdDict[axyValue][1] or "WMZ" in polyIdDict[axyValue][1]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[updateRows.fields.index("LCL_WT_FLG")] = 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; if 'SLOPE_STABILITY_ISSUE' in polyIdDict[axyValue][1] or 'SLOPE_STABILITY_POTENTIAL' in polyIdDict[axyValue][1] or 'SLOPE_STABILITY_VERIFIED' in polyIdDict[axyValue][1] or 'UNSTABLE_SLOPES' in polyIdDict[axyValue][1]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[updateRows.fields.index("LCL_US_FLG")] = 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; #A bit of a work around just for SPS - untl the new schema is completed...
&amp;nbsp;&amp;nbsp;&amp;nbsp; if 'AREA_REGULATION' in polyIdDict[axyValue][1] and polyIdDict[axyValue][3][0] &amp;lt; 50:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[updateRows.fields.index("RETENTION_PCNT_MAX")] = 50
&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow)
del updateRow, updateRows&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:53:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603977#M47210</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-12T01:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: features with identical geometry WKT representation not equal</title>
      <link>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603978#M47211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, I developed something similar that creates a unique string representation of area, centroid X, and centroid Y. It is imperfect, as different datasets may require tweaking of the decimal tolerances, but it works alright the way it is.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def repGeomString(shp):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return str(round(shp.area)) + '|' + str(round(shp.centroid.X, 2)) + '|' + str(round(shp.centroid.Y, 2))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I call this in a search cursor loop and add it to a dictionary with the OID as key, much in the same way you did it. I have experienced finding polygons with mysterious null centroids, but if you account for them somehow that's the only trip-up. This wouldn't be necessary if FindIdentical worked on large datasets. I wish the internal tolerances of this tool were exposed so we could improve these imperfect geometry estimators. I've included a sample function I've wrote that returns a dictionary relating each OID to its overlapping OIDs, based on if repGeomString is equal. Buffering often leads to small changes in shapes that should be identical, and therefore this function gets thrown off sometimes, but usually works quite well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def fasterFindID(fc):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Records geometrical attributes of all features, then returns a dictionary:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; overlapDict: key = OID; value = identical overlap OIDs. The parameter fc
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is assumed to be the product of an overlap operation like Union or Intersect."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; # this creates a representation of a geometry string by concatenating various attributes to create a "unique" identifier
&amp;nbsp;&amp;nbsp;&amp;nbsp; def repGeomString(shp):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return str(round(shp.area)) + '|' + str(round(shp.centroid.X, 2)) + '|' + str(round(shp.centroid.Y, 2))

&amp;nbsp;&amp;nbsp;&amp;nbsp; # two dictionaries to keep track of duplicate geometries and their OIDs
&amp;nbsp;&amp;nbsp;&amp;nbsp; geomDictByOID = {}&amp;nbsp; # key = OID; value = represented geometry string
&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueGeoms = {}&amp;nbsp; # key = represented geometry string; value = list of OIDs with same geometry

&amp;nbsp;&amp;nbsp;&amp;nbsp; oidFieldName = arcpy.Describe(fc).oidFieldName

&amp;nbsp;&amp;nbsp;&amp;nbsp; nullCentroids = []

&amp;nbsp;&amp;nbsp;&amp;nbsp; # gather geometries, and if centroid null, append to list
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc, ("OID@", "SHAPE@")) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # get full k,v pair of OID and geometries
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geomDictByOID[row[0]] = repGeomString(row[1])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # initialize empty list as value of unique geometry key
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueGeoms[repGeomString(row[1])] = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nullCentroids.append(row[0])

&amp;nbsp;&amp;nbsp;&amp;nbsp; # if null centroids exist, convert features to point and reread centroids
&amp;nbsp;&amp;nbsp;&amp;nbsp; # post-conversion, centroids will exist... for some reason
&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(nullCentroids) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Format to string tuple for SQL query, and remove trailing comma for len = 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(nullCentroids) &amp;gt; 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nullCentroidsFormat = str(tuple(nullCentroids))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nullCentroidsFormat = str(tuple(nullCentroids)).replace(',', '')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(fc, 'nLyr', '"{0}" IN {1}'.format(oidFieldName, nullCentroidsFormat))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nullCentroidsPts = arcpy.FeatureToPoint_management('nLyr', arcpy.Describe(fc).name + 'NullCentroids')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # loop through null centroid features and read new centroids
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(nullCentroidsPts, ("OID@", "SHAPE@")) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # get full k,v pair of OID and geometries
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geomDictByOID[row[0]] = repGeomString(row[1])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # initialize empty list as value of unique geometry key
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueGeoms[repGeomString(row[1])] = []

&amp;nbsp;&amp;nbsp;&amp;nbsp; # for each geometry key in uniqueGeoms, append all OIDs that match
&amp;nbsp;&amp;nbsp;&amp;nbsp; for oid, g in geomDictByOID.iteritems():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueGeoms&lt;G&gt;.append(oid)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create dictionary that relates each oid to its overlaps
&amp;nbsp;&amp;nbsp;&amp;nbsp; overlapDict = {}
&amp;nbsp;&amp;nbsp;&amp;nbsp; for oid, g in geomDictByOID.iteritems():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(uniqueGeoms&lt;G&gt;) &amp;gt; 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; overlapDict[oid] = [k for k in uniqueGeoms&lt;G&gt; if k != oid]

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Delete potentially large dicts
&amp;nbsp;&amp;nbsp;&amp;nbsp; del geomDictByOID
&amp;nbsp;&amp;nbsp;&amp;nbsp; del uniqueGeoms

&amp;nbsp;&amp;nbsp;&amp;nbsp; return overlapDict&lt;/G&gt;&lt;/G&gt;&lt;/G&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:53:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/features-with-identical-geometry-wkt/m-p/603978#M47211</guid>
      <dc:creator>JamieKass</dc:creator>
      <dc:date>2021-12-12T01:53:58Z</dc:date>
    </item>
  </channel>
</rss>

