Select to view content in your preferred language

how to change the direction for the line feature of endpoint to the SUB point feature at a time in Arcgis pro

1717
3
Jump to solution
07-06-2023 11:55 PM
Labels (1)
YuvarajuDhananjay
New Contributor II

I have a line layer and SUB point layer, where these lines directions are random, I need all these line endpoints should be on SUB points, I have tried Flip line but it will change the correct direction lines also, anyone can help with this? 

1 Solution

Accepted Solutions
DuncanHornby
MVP Notable Contributor

There are several ways to achieve this, the easiest would be with a few lines of python code. As you don't state in your question if python is an option I assume you are looking for a non-coding solution?

The tool Feature Vertices To Points allows you to specify which vertices, in your case end-points that should be extracted.

Then is a matter of creating a new field in your line dataset and populating it with a do I flip or do I not flip the line value. You achieve that by selecting the end points using your SUB point layer (select by layer tool) and using that selection to pass the selection back to you lines and update that field. Then a final step is select all lines using your field you want to run the flip tool on.

View solution in original post

0 Kudos
3 Replies
DuncanHornby
MVP Notable Contributor

There are several ways to achieve this, the easiest would be with a few lines of python code. As you don't state in your question if python is an option I assume you are looking for a non-coding solution?

The tool Feature Vertices To Points allows you to specify which vertices, in your case end-points that should be extracted.

Then is a matter of creating a new field in your line dataset and populating it with a do I flip or do I not flip the line value. You achieve that by selecting the end points using your SUB point layer (select by layer tool) and using that selection to pass the selection back to you lines and update that field. Then a final step is select all lines using your field you want to run the flip tool on.

0 Kudos
sinekelly1410
New Contributor II

Hi @DuncanHornby 

I think I am trying to do something sort of similar - I have a line dataset where the lines are in different directions, and just need all the lines to go in the same direction. 

I have used the 'Feature Vertices to Points' tool to extract all the end points. If all the lines where in the same direction, there would be 1 point at each junction between line segments. However, because some lines are in different directions, there are some junctions with 2 end points, and some junctions with 0 end points. 

Is there a way to select the lines that touch 2 points at one vertex, and 0 points at the other vertex, and use this selection of lines to flip the direction of? 

Though I would rather use standard functions where possible, I can create a script tool to modify tools slightly, so if there is a solution that includes some python code then this is fine. 

0 Kudos
DuncanHornby
MVP Notable Contributor

You could explore the Collect Events tool to count your stacked points then use that new layer to select only 2-count points then you can do the select by location using those selected subset?

I have to say questions like yours are ALWAYS better if accompanied with a screen shot/sketch  as you have obfuscated the nature of your dataset by not saying what it is, rivers, roads, shipping lanes etc...

0 Kudos