Select to view content in your preferred language

Extracting non-endpoint vertices from lines

436
6
Jump to solution
09-19-2024 07:50 AM
Labels (3)
Markbe_utco
Regular Contributor

I'm looking for a way to extract non-endpoint vertices from a line.  I know there is a tool called Feature Vertices to Points but this tool only extracts vertices using either the All Vertices, Start Vertex, or End Vertex point types.  I'm looking for a way to extract the all vertices between the starting and ending vertices. 

Any suggestions?

Note: The Feature Vertices to Points tool has an option to select Midpoint as the point type.  Using this option creates a point at the midpoint of the line, even if no actual vertex exists at that point of the line.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DavidSolari
Frequent Contributor

You can even do start & end in one pass, something like:

DavidSolari_0-1727369719418.png

 

View solution in original post

6 Replies
DavidSolari
Frequent Contributor

You can use Python to read the geometry field using Cursors, then extract the in-between vertices using methods on the Polyline objects the cursor returns, then use another cursor to write the results where you need it.

0 Kudos
Markbe_utco
Regular Contributor

How is this done within Model Builder?

0 Kudos
DavidSolari
Frequent Contributor

You might be able to use the Calculate Value utility to run all the Python code you need, but I think that just overcomplicates things. You're better off writing this as a script tool. If you're not comfortable with that then hopefully someone with more Modelbuilder experience can help.

DuncanHornby
MVP Notable Contributor

If you want to do this in model builder do this:

  1. Extract all vertices
  2. Extract start vertices
  3. Extract end vertices
  4. Use start vertices to select intersecting all vertices
  5. Use end vertices to add to selection intersecting all vertices
  6. Delete selection from all vertices.

This can very easily be done in modelbuilder.

DavidSolari
Frequent Contributor

You can even do start & end in one pass, something like:

DavidSolari_0-1727369719418.png

 

DuncanHornby
MVP Notable Contributor

Fine tuned to perfection, nice! 🙂

0 Kudos