Skip to main content
Solved

Removing all intermediate vertices from polylines


Hi,

I have searched everywhere but can't seem to find a solution to a this simple task.

I want to remove all intermediate vertices from my polylines, result should be polylines consisting of just the original start and ending points.

Can anyone point me in the right direction? Thanks!

Best answer by takashi

Hi @johannesbloemen, the CoordinateRemover transformer might help you.

  • Keep or Remove Coordinates: Remove
  • Coordinate Index: 1
  • Number to Remove: @NumCoords()-2

View original
Did this help you find an answer to your question?

3 replies

takashi
Supporter
  • Best Answer
  • June 5, 2017

Hi @johannesbloemen, the CoordinateRemover transformer might help you.

  • Keep or Remove Coordinates: Remove
  • Coordinate Index: 1
  • Number to Remove: @NumCoords()-2


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • June 5, 2017

Another way:

Use two CoordinateExtractor transformers (index 0 for start and -1 for end points) to store coordinates in attributes.

Then a VertexCreator (using start coordinates from attributes and setting to replace geometry with point) to create the start point.

And a second VertexCreator (using end coordinates from attributes and setting to add a vertex) to create the line from start to end point.


takashi wrote:

Hi @johannesbloemen, the CoordinateRemover transformer might help you.

  • Keep or Remove Coordinates: Remove
  • Coordinate Index: 1
  • Number to Remove: @NumCoords()-2

Thank you takashi, that did the trick.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings