Skip to main content

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!

Hi @johannesbloemen, the CoordinateRemover transformer might help you.

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


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.


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.

 

 


Reply