I have Point Of Interest (POI) data for two different years. I wrote code to get two feature classes where each contains the POIs that differ (spatially) from the other release. I make mostly use of the arcpy.SelectLayerByLocation_management
.
# Get intersection from the "new side"
arcpy.SelectLayerByLocation_management(new_layer, "ARE_IDENTICAL_TO", old_layer, "", "NEW_SELECTION")
# This selection contains NEW WITHOUT OLD
arcpy.SelectLayerByLocation_management(new_layer, "", "", "", "SWITCH_SELECTION")
# NEW WITHOUT OLD feature layer output
arcpy.CopyFeatures_management(new_layer, new_diffs)
# Get intersection
# First switch the selection from the previous layer again
arcpy.SelectLayerByLocation_management(new_layer, "", "", "", "SWITCH_SELECTION")
# Then proceed as above
# Get intersection from the "old side"
arcpy.SelectLayerByLocation_management(old_layer, "ARE_IDENTICAL_TO", new_layer, "", "NEW_SELECTION")
# This selection contains OLD WITHOUT NEW
arcpy.SelectLayerByLocation_management(old_layer, "", "", "", "SWITCH_SELECTION")
# OLD WITHOUT NEW feature layer output
arcpy.CopyFeatures_management(old_layer, old_diffs)
It works ok, but I don't got the cases where the POI location may have changed a tiny bit (maybe to a more accurate position) but the POI itself is the same. I would NOT want to have these included in the output, or in other words, I would not classify them as a real difference. So I additionally might want to compare with something like a arcpy.Buffer_analysis
and check for additional POI's names if they are equal to the one which differs spatially.
Is there an easy way to integrate this functionality into my code?
The unique IDs for the POIs change from release to release, so they are not 100% identifiable throughout different releases (yes, really, I also couldn't believe it). But it should be enough for me to just check for equal names.
EDIT:
I drew a picture to make it a Little bit more clear what I want to get.