Hi all,
I have been using ArcMap for some years for basic stuff and recently switched to ArcPro while trying to use arcpy at the same time. Therefore, I would appreciate any suggestions that I could use either in ArcPro as a tool or code in arcpy (if possible with explanations what exactly the code does).
Here's my question:
I have a shapefile of lines (road fragments) and I want to find points where at least 4 of those lines intersect. All I could find where ways to determine intersections of two features from the same shapefile or the intersections of features from several shapefiles. Is there a way to define the number of intersecting features from one shapefile?
To give you a bit of an impression of how my shapefile looks like, here a screenshot:
As you can see, there are some hubs (red) where a lot of lines intersect and those are exactly the points I want to find. Is there any way to that other than manually?
Many thanks in advance!
Deborah
Solved! Go to Solution.
Thanks again for your suggestiond. After trying a few things, I just went with intersecting the layer with itself and then using Aggregate Points to find locations with many intersections. I then filtered them, converted the feature class back to a point layer and repeated the progress to refine the results. I know, it's probably a bit complicated and not the straightforward way but it worked for now.
Maybe just an Intersect to itself, with a point output, then spatial join the output points back to the lines to get a JOIN_COUNT, then filter where it's >=4
given line inputs and point outputs, David's suggestion of intersect is one to pursue,
How Intersect works—ArcGIS Pro | Documentation
however, be aware that it is moderately unlikely that the intersections points will exactly as you planned.
I would convert the shapefile to a featureclass in a file geodatabase so that you can have control over the tolerance aspects of the geometry. If you don't you may end up with 4 or more lines that appear to intersect one location but in reality they are separated by some small but finite distance and you won't get your desired point count. You may need to follow up with examining these clusters to achieve your end goal.
Thank you, @DavidPike and @DanPatterson! I think you're right and I have to include some tolerance. I'll play a bit with the intersection tool and see if I can work it out by adjusting the feature class geometry. I'll have to manually cross-check it with Google Earth afterwards anyway, but I thought it would spare me some time if I can partially automate that step and then just edit the points. This is just a small subset of my data and I'll have to apply the procedure to the whole dataset later.
Thanks again for your suggestiond. After trying a few things, I just went with intersecting the layer with itself and then using Aggregate Points to find locations with many intersections. I then filtered them, converted the feature class back to a point layer and repeated the progress to refine the results. I know, it's probably a bit complicated and not the straightforward way but it worked for now.