I have a pipeline feature class (line) and a pumping station feature class (polygon). Now, I wants to retrieve the endpoints of pipelines (green points) inside pumping stations. I have used the "Intersect" geoprocessing tool but it only retrieves the intersections of pipelines and pumping stations (grey points). How can I do so by arcPy?
Solved! Go to Solution.
From How Intersect works—ArcGIS Pro | Documentation
with the intersection set to Polygon and line input for line output
You will get a line as the output. It is just a matter then of querying the line's start and endpoint as to whether it is furthest from the edge. One will be on the edge (Near distance of 0) and the other will be inside (Near distance > 0). Odd cases you probably won't encounter is when the line is exactly on a polygon edge (Near distance == 0 for both)
Maybe start with a temporary layer of start nodes and end nodes from the pipelines? There is a tool to do this. Then overlays of the node points would give you the ends. Keep track of the objectids to get references to the original lines.
From How Intersect works—ArcGIS Pro | Documentation
with the intersection set to Polygon and line input for line output
You will get a line as the output. It is just a matter then of querying the line's start and endpoint as to whether it is furthest from the edge. One will be on the edge (Near distance of 0) and the other will be inside (Near distance > 0). Odd cases you probably won't encounter is when the line is exactly on a polygon edge (Near distance == 0 for both)
Many thx.
Maybe start with a temporary layer of start nodes and end nodes from the pipelines? There is a tool to do this. Then overlays of the node points would give you the ends. Keep track of the objectids to get references to the original lines.