Skip to main content
deleted 22 characters in body; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How do I deselect the Deselecting original feature from a selection of both original and duplicate features?

The problem: I have a field which is supposed to hold a unique identifier, however due to issues with Attribute Assistant I have multiple features which have the same unique ID. I want to write a script which will select duplicates and remove the originals from the selection. The duplicated field is FID, the originals will have a lower OID (also, there can be more than one duplicate).

So far: I have used SelectLayersByAttribute_management to select features where there are more than one feature with the same FID:

arcpy.SelectLayerByAttribute_management("MyLayer", "NEW_SELECTION", "FID In (SELECT FID FROM MyFeatureClass GROUP BY FID HAVING Count(*)>1))

So thisThis selects both originals and duplicates, but how do I now remove the features which have the original FID value? 

The originals will have a lower OID value:

OID   FID
 1    x101    ORIGINAL
 2    x101    DUPLICATE
 3    x102    ORIGINAL
 4    x102    DUPLICATE
 5    x102    DUPLICATE

EDIT: I'm using ArcMap 10.2.1

How do I deselect the original feature from a selection of both original and duplicate features?

The problem: I have a field which is supposed to hold a unique identifier, however due to issues with Attribute Assistant I have multiple features which have the same unique ID. I want to write a script which will select duplicates and remove the originals from the selection. The duplicated field is FID, the originals will have a lower OID (also, there can be more than one duplicate).

So far: I have used SelectLayersByAttribute_management to select features where there are more than one feature with the same FID:

arcpy.SelectLayerByAttribute_management("MyLayer", "NEW_SELECTION", "FID In (SELECT FID FROM MyFeatureClass GROUP BY FID HAVING Count(*)>1))

So this selects both originals and duplicates, how do I now remove the features which have the original FID value? The originals will have a lower OID value:

OID   FID
 1    x101    ORIGINAL
 2    x101    DUPLICATE
 3    x102    ORIGINAL
 4    x102    DUPLICATE
 5    x102    DUPLICATE

EDIT: I'm using ArcMap 10.2.1

Deselecting original feature from selection of both original and duplicate features?

I have a field which is supposed to hold a unique identifier, however due to issues with Attribute Assistant I have multiple features which have the same unique ID. I want to write a script which will select duplicates and remove the originals from the selection. The duplicated field is FID, the originals will have a lower OID (also, there can be more than one duplicate).

I have used SelectLayersByAttribute_management to select features where there are more than one feature with the same FID:

arcpy.SelectLayerByAttribute_management("MyLayer", "NEW_SELECTION", "FID In (SELECT FID FROM MyFeatureClass GROUP BY FID HAVING Count(*)>1))

This selects both originals and duplicates, but how do I now remove the features which have the original FID value? 

The originals will have a lower OID value:

OID   FID
 1    x101    ORIGINAL
 2    x101    DUPLICATE
 3    x102    ORIGINAL
 4    x102    DUPLICATE
 5    x102    DUPLICATE

I'm using ArcMap 10.2.1

added 29 characters in body
Source Link
TeddyTedTed
  • 6.3k
  • 1
  • 15
  • 37

The problem: I have a field which is supposed to hold a unique identifier, however due to issues with Attribute Assistant I have multiple features which have the same unique ID. I want to write a script which will select duplicates and remove the originals from the selection. The duplicated field is FID, the originals will have a lower OID (also, there can be more than one duplicate).

So far: I have used SelectLayersByAttribute_management to select features where there are more than one feature with the same FID:

arcpy.SelectLayerByAttribute_management("MyLayer", "NEW_SELECTION", "FID In (SELECT FID FROM MyFeatureClass GROUP BY FID HAVING Count(*)>1))

So this selects both originals and duplicates, how do I now remove the features which have the original FID value? The originals will have a lower OID value:

OID   FID
 1    x101    ORIGINAL
 2    x101    DUPLICATE
 3    x102    ORIGINAL
 4    x102    DUPLICATE
 5    x102    DUPLICATE

EDIT: I'm using ArcMap 10.2.1

The problem: I have a field which is supposed to hold a unique identifier, however due to issues with Attribute Assistant I have multiple features which have the same unique ID. I want to write a script which will select duplicates and remove the originals from the selection. The duplicated field is FID, the originals will have a lower OID (also, there can be more than one duplicate).

So far: I have used SelectLayersByAttribute_management to select features where there are more than one feature with the same FID:

arcpy.SelectLayerByAttribute_management("MyLayer", "NEW_SELECTION", "FID In (SELECT FID FROM MyFeatureClass GROUP BY FID HAVING Count(*)>1))

So this selects both originals and duplicates, how do I now remove the features which have the original FID value? The originals will have a lower OID value:

OID   FID
 1    x101    ORIGINAL
 2    x101    DUPLICATE
 3    x102    ORIGINAL
 4    x102    DUPLICATE
 5    x102    DUPLICATE

The problem: I have a field which is supposed to hold a unique identifier, however due to issues with Attribute Assistant I have multiple features which have the same unique ID. I want to write a script which will select duplicates and remove the originals from the selection. The duplicated field is FID, the originals will have a lower OID (also, there can be more than one duplicate).

So far: I have used SelectLayersByAttribute_management to select features where there are more than one feature with the same FID:

arcpy.SelectLayerByAttribute_management("MyLayer", "NEW_SELECTION", "FID In (SELECT FID FROM MyFeatureClass GROUP BY FID HAVING Count(*)>1))

So this selects both originals and duplicates, how do I now remove the features which have the original FID value? The originals will have a lower OID value:

OID   FID
 1    x101    ORIGINAL
 2    x101    DUPLICATE
 3    x102    ORIGINAL
 4    x102    DUPLICATE
 5    x102    DUPLICATE

EDIT: I'm using ArcMap 10.2.1

deleted 164 characters in body
Source Link
Midavalo
  • 29.9k
  • 11
  • 51
  • 105

The problem: I have a field which is supposed to hold a unique identifier, however due to issues with Attribute Assistant I have multiple features which have the same unique ID. I want to write a script which will select duplicates and remove the originals from the selection. The duplicated field is FID, the originals will have a lower OID (also, there can be more than one duplicate).

So far: I have used SelectLayersByAttribute_management to select features where there are more than one feature with the same FID:

arcpy.SelectLayerByAttribute_management("MyLayer", "NEW_SELECTION", "FID In (SELECT FID FROM MyFeatureClass GROUP BY FID HAVING Count(*)>1))

So this selects both originals and duplicates, how do I now remove the features which have the original FID value? The originals will have a lower OID value:

OID   FID
 1    x101    ORIGINAL
 2    x101    DUPLICATE
 3    x102    ORIGINAL
 4    x102    DUPLICATE
 5    x102    DUPLICATE

Thanks

p.s. The next issue I know I will face will be figuring out how to run Attribute Assistant rules using ArcPy, any tips for this would also be appreciated.

The problem: I have a field which is supposed to hold a unique identifier, however due to issues with Attribute Assistant I have multiple features which have the same unique ID. I want to write a script which will select duplicates and remove the originals from the selection. The duplicated field is FID, the originals will have a lower OID (also, there can be more than one duplicate).

So far: I have used SelectLayersByAttribute_management to select features where there are more than one feature with the same FID:

arcpy.SelectLayerByAttribute_management("MyLayer", "NEW_SELECTION", "FID In (SELECT FID FROM MyFeatureClass GROUP BY FID HAVING Count(*)>1))

So this selects both originals and duplicates, how do I now remove the features which have the original FID value? The originals will have a lower OID value:

OID   FID
 1    x101    ORIGINAL
 2    x101    DUPLICATE
 3    x102    ORIGINAL
 4    x102    DUPLICATE
 5    x102    DUPLICATE

Thanks

p.s. The next issue I know I will face will be figuring out how to run Attribute Assistant rules using ArcPy, any tips for this would also be appreciated.

The problem: I have a field which is supposed to hold a unique identifier, however due to issues with Attribute Assistant I have multiple features which have the same unique ID. I want to write a script which will select duplicates and remove the originals from the selection. The duplicated field is FID, the originals will have a lower OID (also, there can be more than one duplicate).

So far: I have used SelectLayersByAttribute_management to select features where there are more than one feature with the same FID:

arcpy.SelectLayerByAttribute_management("MyLayer", "NEW_SELECTION", "FID In (SELECT FID FROM MyFeatureClass GROUP BY FID HAVING Count(*)>1))

So this selects both originals and duplicates, how do I now remove the features which have the original FID value? The originals will have a lower OID value:

OID   FID
 1    x101    ORIGINAL
 2    x101    DUPLICATE
 3    x102    ORIGINAL
 4    x102    DUPLICATE
 5    x102    DUPLICATE
Source Link
TeddyTedTed
  • 6.3k
  • 1
  • 15
  • 37
Loading