I have a line feature class (saved in a feature dataset within a File GDB) which is comprised of a set of intersecting lines. I
I have used the Add Geometry tool to add Start_XStart_X
, Start_YStart_Y
, End_XEnd_X
and End_YEnd_Y
fields to the attribute table. The lines are not all orientated in the same direction, so for certain pairs of features in the table, End_X = End_XEnd_X = End_X
and End_Y = End_YEnd_Y = End_Y
. I
I want to use the Select Layer By Attributes toolSelect Layer By Attributes tool with an SQL query (if possible) to select only lines in the table with matching end coordinatesmatching end coordinates and then run the Flip Line toolFlip Line tool on the selection in order to reverse the direction of the selected linesreverse the direction of the selected lines. It's
It's also worth noting that the OIDs are in a random order, e.g. line 1 may be connected to line 10.
Is it possible to use an SQL statement to select features in an attribute table based on the values of other features?
I tried SELECT * FROM table_name WHERE: END_X = END_X AND END_Y = END_Y AND OBJECTID <> OBJECTID
SELECT * FROM table_name WHERE:
END_X = END_X AND END_Y = END_Y AND OBJECTID <> OBJECTID
I'm sure it will be obvious to most that all that does is search each row individually and come up with nothing, though hopefully it gives an idea as to what I'm trying to do.
If it is not possible using SQL, is it something that could be done with Arcpy Search Cursors? (I am an extreme novice with Arcpy/Python scripting. I just know Search Cursors exist and can be used to find records in tables.)