Hi, I need to compare two features in the same feature class. I'd like to test to see if they intersect. Specifically, I have a feature set composed of lines, and I'd like to know if any given two are intersecting. What is a quick and easy way to do this?
As nice as it is to not have to create another feature class, often times it can be much more straightforward to just create one (possibly just in memory). Have you looked at the Pairwise Intersect—Help | ArcGIS Desktop :
Pairwise intersection refers to selecting one feature from the first input and intersecting it with all those features in the second input that it overlaps.
The Pairwise Intersect tool is similar to the Intersect tool in that geometric intersections are computed, but it is significantly different in that intersections are computed on pairs of features rather than all combinations of features. You may find this tool useful in situations where the Intersect tool results in an output with many more features than were input
Take a polygon/polyline with 5 points, the first and last are repeated, since it is a closed loop, if the points are sequential and not made up of individual segments. You can't tell this by visual inspection.
Four points, made into 4 segments, hence duplication in points.
Arrange the points as either 4 sequential numbers or pairs of two numbers.
As the question?
Which segments does a particular point (eg (1.5, 1.5) in the lower left) belong to? A little query magic (details depend on how you want to implement this) and it is visually obvious and the query supports that the point belongs to the first and last segment.
Now... There is no `tool` that does this, but you can get at the numbers if you can dissociate the lines to segments if they already aren't segments.... then get the points of the segments. From there it is a `query`.
I did all of this in python and numpy, but it can be done with featureclasses and tables and arcpy if needed.
Original points : clockwise from lower-left |
---|
|
From-to points for the 4 segments |
|
|
|