<?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 do i clear duplicate entities created in feature classes in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-do-i-clear-duplicate-entities-created-in/m-p/361464#M28530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this helps you:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/15431"&gt;Removing Duplicate feature Points/Records&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or this:&lt;/P&gt;&lt;P&gt;&lt;A href="http://arcscripts.esri.com/details.asp?dbid=15138" title="http://arcscripts.esri.com/details.asp?dbid=15138"&gt;Find and Delete Spatially Duplicate Records in a Shapefile&lt;/A&gt;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2015 08:18:02 GMT</pubDate>
    <dc:creator>JohannesBierer</dc:creator>
    <dc:date>2015-04-16T08:18:02Z</dc:date>
    <item>
      <title>how do i clear duplicate entities created in feature classes</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-clear-duplicate-entities-created-in/m-p/361463#M28529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how do i clear duplicate entities created while copying data in feature classes assuming the duplicates are at same XYZ locations as the original data, i am working on Point and Line data, is there any inbuilt tool in Arc Gis which i can use for the same?Can anyone help me with a python script here for the purpose.how do i clear duplicate entities created while copying data in feature classes assuming the duplicates are at same XYZ locations as the original data, i am working on Point and Line data, is there any inbuilt tool in Arc Gis which i can use for the same?Can anyone help me with a python script here for the purpose.Thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 08:00:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-clear-duplicate-entities-created-in/m-p/361463#M28529</guid>
      <dc:creator>TanmayNaik</dc:creator>
      <dc:date>2015-04-16T08:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: how do i clear duplicate entities created in feature classes</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-clear-duplicate-entities-created-in/m-p/361464#M28530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this helps you:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/15431"&gt;Removing Duplicate feature Points/Records&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or this:&lt;/P&gt;&lt;P&gt;&lt;A href="http://arcscripts.esri.com/details.asp?dbid=15138" title="http://arcscripts.esri.com/details.asp?dbid=15138"&gt;Find and Delete Spatially Duplicate Records in a Shapefile&lt;/A&gt;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 08:18:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-clear-duplicate-entities-created-in/m-p/361464#M28530</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2015-04-16T08:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: how do i clear duplicate entities created in feature classes</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-clear-duplicate-entities-created-in/m-p/361465#M28531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Find Identical (Data Management)&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000054000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000054000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete Identical (Data Management)&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000053000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000053000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 10:12:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-clear-duplicate-entities-created-in/m-p/361465#M28531</guid>
      <dc:creator>KishorGhatage</dc:creator>
      <dc:date>2015-04-16T10:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: how do i clear duplicate entities created in feature classes</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-clear-duplicate-entities-created-in/m-p/361466#M28532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an updated version of my Find and Delete Spatially Duplicate Records in a Shapefile.&amp;nbsp; This code works in ArcGIS 10.1+ and does not require and advance license, it works on any feature class, and it runs much faster relying on geometry and not selections. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The geometry compare only uses X and y and not z values, sorry but the method comes that way from ESRI.&amp;nbsp; There is no consideration of the attribute table but the tool preserves the original FC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Find And Delete Spatially Duplicate Records in a Feature Class..."
&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "A Two-Bit Algorithms product\nby Gerry Gabrisch (&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:geraldg@lummi-nsn.gov" rel="nofollow noopener noreferrer" target="_blank"&gt;geraldg@lummi-nsn.gov&lt;/A&gt;&lt;SPAN&gt;)"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Copy?Right! 2015...Free to hack with with attribution."
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; import sys, traceback, time
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp; from arcpy import env
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; env.overwriteOutput = True


&amp;nbsp;&amp;nbsp;&amp;nbsp; #the input FC with duplicate records....
&amp;nbsp;&amp;nbsp;&amp;nbsp; inFC= r"C:\gTemp\Converted_Graphics.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp; #The output FC that will have duplicate records purged....
&amp;nbsp;&amp;nbsp;&amp;nbsp; outFC = r"C:\gTemp\Converted_GraphicsTEST.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(inFC, outFC)

&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(inFC, ["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; with arcpy.da.UpdateCursor(outFC, ["OID@", "SHAPE@"]) as cursor2:
&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; dupcount = 0
&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; for row2 in cursor2:
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cursor[1].equals(cursor2[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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dupcount +=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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dupcount &amp;gt;=2:
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dupcount = 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor2.deleteRow()

&amp;nbsp;&amp;nbsp;&amp;nbsp; 
except arcpy.ExecuteError: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "error"
&amp;nbsp;&amp;nbsp;&amp;nbsp; msgs = arcpy.GetMessages(2) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError(msgs)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print msgs
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "error"
&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = sys.exc_info()[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp; tbinfo = traceback.format_tb(tb)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + "\nError Info:\n" + str(sys.exc_info()[1])
&amp;nbsp;&amp;nbsp;&amp;nbsp; print pymsg + "\n"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:51:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-clear-duplicate-entities-created-in/m-p/361466#M28532</guid>
      <dc:creator>GerryGabrisch</dc:creator>
      <dc:date>2021-12-11T16:51:54Z</dc:date>
    </item>
  </channel>
</rss>

