6

Recently was doing some work on an old layer and found that when I selected one point, or used the identify tool I was returning SEVEN points when it should just be one! I am currently using an ArcGIS 10.1 and have access to both Editor and Info licenses.

Is there an easy way to delete these duplicates via python, or another tool? The ObjectIDs are different but the values contained in other fields are the same. Therefore I think looking at intersecting geometry would be the best option There is probably easily over 2000 points with duplicates.

Thanks.

2
  • What license level have you access to?
    – Martin
    Commented Aug 21, 2013 at 14:22
  • @Martin Primarily Editor but I can also use Info I added some info to the original question
    – GISHuman
    Commented Aug 21, 2013 at 14:24

5 Answers 5

10

How about this:

Generate X/Y for each point.

Dissolve Using X/Y as the Dissolve_Field(s).

Note: The dissolve tool is located Data Management Tools > Generalization > Dissolve.

4
  • Dissolving by XY will not actually remove duplicate points. In fact, it will create multi-point features that will have many stacked points that all have the same record in the attribute table. Commented Aug 21, 2013 at 15:37
  • Hmm. I don't think I understand what you mean. I did test it and it appeared to work. Doesn't the dissolve tool dissolve/combine all of the features that have the same value in the the Dissolve Field(s) (in this case XY)? resources.arcgis.com/en/help/main/10.1/index.html#//…
    – pbh
    Commented Aug 21, 2013 at 15:48
  • I apologize. After further testing, I see that it does generate a single feature in the overlapping XY location. Commented Aug 21, 2013 at 16:34
  • I did a combination of all three answers where I created a unique ID from the X and Y coordinates along with another field, summarized the fields, joined and then used dissolve. Thanks!
    – GISHuman
    Commented Aug 27, 2013 at 14:59
9

You can use shape field as the compare fields in the Delete Identical tool (ArcInfo/Advanced level only).

If you have problems using this tool you may follow the steps below;

  1. Add a field called X
  2. Add a field called Y
  3. Calculate geometry for X and Y fields.
  4. Export the attribute table to text file.
  5. Open it on Excel
  6. Use X and Y fields for remove duplicates function.
  7. Import the txt back into ArcGIS to create a new shapefile with removed values.
4

Pythonic way of what Brad Neson and help for GISKid too..

import arcpy
arcpy.env.overwriteOutput=True
fc= r"C:\Users\USER_NAME\Documents\ArcGIS\CWS.shp" ## path to your input feature class
output = r"C:\Users\USER_NAME\Documents\ArcGIS\CWS_Unique.shp"   ## path to your output feature class

arcpy.AddField_management(fc,"_unqfld_","TEXT","","","","","NULLABLE")## "_unqfld_" is the unique field where concatenation to be applied

curU  = arcpy.UpdateCursor(fc)
for row in curU:
    row._unqfld_=row.X+row.Y ## "X" and "Y" are the field  name  to be concatenated
    curU.updateRow(row)
del curU
arcpy.Dissolve_management(fc,output,"_unqfld_" ,"","","")
1

without the delete identical tool,
I often concat two fields together that make them identical but unique from others,
summarize and join that back.
EDIT: you would maybe during the join select through each set of unique values (from the concat) take the min oid value and edit it's summary value to 1.

select all that have a value greater than 1,
and delete.

1
  • I like this method but I have over 11000 duplicates! Can someone add to this with python and a search cursor? For example now if I sort by OID the OID is unique for one point with the duplicates. (eg. 7 instances of the same OID indicate overlapping (same point)). Is there a way in python to save the first instance of the OID and delete the rest of them?
    – GISHuman
    Commented Aug 21, 2013 at 15:02
1

You can also use the Collect Events tool, which will create a new dataset and add a field with the count of overlapping points. This one is particularly useful when you want to keep a record of how many overlapping points there were for each location.

Note that this tool is part of the Spatial Statistics toolbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.