Skip to main content
Question

Split line at regular intervals

  • July 10, 2020
  • 7 replies
  • 854 views

I want to split a line at regular interval distance

Q1. Assuming the above is a 50m distance line and I want to split at 20m distance, If I split the above , I would get two segments of 20m distance and one 10m distance segment.

Q2. I want to do the splits starting from both (A) and (B)

 

Can anyone advise on how this is done?

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • July 10, 2020

For A there is a custom transformer available on the hub, the DistanceChopper, which does the trick.

B is a bit trickier, you could use a Snipper to cut off segments one by one but since it works relative to the start point of the line you'll need to flip the line after every segment using the Orienter. That means looping in a custom transformer.

That should do the trick.

cutlinefrombothends.fmw


fme-phile
Forum|alt.badge.img+1
  • 18 replies
  • July 12, 2020

Hi @josephjose Try the 'lineSnipper' custom transformer. I used this within the custom transformer 'ContourLabeller' I created to add contour labels at different intervals on the contour lines. Works perfectly.


chandan
  • 8 replies
  • July 12, 2020

redgeographics it's really a good idea to add Orientor. But you added this inside custom transformer, I guess this operation can be done without loop. Input can be passed to two different transformer, one would be Snipper and another will be Orientor followed by another Snipper.


Forum|alt.badge.img+2
  • 194 replies
  • July 12, 2020

Densify the line to generate choppable vertices, chop by X units for line 1, change line direction for line 2, and chop again.

When you are done, you can simplify the line line to remove the extra vertices.

 

Attached .fmwt

 

Result

 

Both lines

Line 1

Line 2

 


  • Author
  • 15 replies
  • July 17, 2020

Hi @josephjose Try the 'lineSnipper' custom transformer. I used this within the custom transformer 'ContourLabeller' I created to add contour labels at different intervals on the contour lines. Works perfectly.

Thanks. Can you please share me a link to this transformer?


  • Author
  • 15 replies
  • July 17, 2020

Thank you guys. Let me have a roll of all the options


  • Author
  • 15 replies
  • July 17, 2020