This question is an exact duplicate of:

I have a shapefile containing polygons. I would like to select all polygons within the layer that overlap with other polygons within the same layer.

The closest I have gotten is the Intersect tool in ArcMap. However, the problem with it is that, while it does find the overlapping polygons it also cuts them up and only keeps the parts of the polygons that overlap and not the whole polygon. I would like a tool that selects them and gives me the full polygons without cutting them.

I am using ArcPy.


I have managed to achieve this using the code below. The problem now is performance. Is there a better way of doing this or a way of improving the performance of this one?

    with arcpy.da.SearchCursor("lyr_existing_cadastre", ["OBJECTID"]) as search_cursor:
    for row in search_cursor:
        # Get the OBJECTID of row and use it to select row
        arcpy.SelectLayerByAttribute_management("lyr_existing_cadastre", "NEW_SELECTION",
                                                "\"OBJECTID\" = " + str(row[0]))

        # Copy row into a new feature class called row
            "lyr_existing_cadastre", "lyr_row", "NO_TEST")

        # Remove row from the input

        # Select all features that intersect with row and copy them into the row feature class
            "lyr_existing_cadastre", "INTERSECT", "lyr_row", selection_type="NEW_SELECTION")
            "lyr_existing_cadastre", "lyr_row", "NO_TEST")

        # If there is more than one feature in the row feature class
        # meaning there was something else in addition to row then delete those overlaps
        # from the input and append everything in row into the output feature class
        if (int(arcpy.GetCount_management("lyr_row").getOutput(0)) > 1):
                "lyr_row", "lyr_Overlapping_Polygons", "NO_TEST")
                "lyr_row", "lyr_Remaining_Polygons", "NO_TEST")

            "lyr_existing_cadastre", "CLEAR_SELECTION")
            "lyr_row", "CLEAR_SELECTION")
del search_cursor

marked as duplicate by BERA, PolyGeo arcpy Feb 1 at 11:18

This question was marked as an exact duplicate of an existing question.

  • 2
    Select with location using the intersection as selecting features. If you only want to find the overlaps the simplest and fastest way (if you have more than basic license) is to use Geodatabase topology. – BERA Jan 31 at 10:01
  • 1
    @BERA sounds like an answer. – artwork21 Jan 31 at 13:24
  • Use the arcpy geometry tools to identify overlapping records. desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-classes/… – GBG Jan 31 at 15:51
  • @GBG the geometry tools look quite promising. But it looks like I would need to add them to a search cursor or something to get it to identify all the records that contain overlaps. How would that impact performance? – Bhekani Khumalo Feb 1 at 8:11

You can Select By Location with your original shape as in_layer and your intersect output as select features.

Or you can use geodatabase topology which is very fast and will allow you to correct your input data without creating a new feature class. Create a file geodatabase and a feature dataset, export your shape to the feature dataset and create the topology:

enter image description here

  • Looks promising. Is it possible to export all the polygons that have overlaps into a new feature class? – Bhekani Khumalo Feb 1 at 8:13
  • @BhekaniKhumalo why dont you try for yourself. It will be faster than asking me – BERA Feb 1 at 9:05

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