Question

Split line at regular intervals

  • 10 July 2020
  • 7 replies
  • 150 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?

 


7 replies

Userlevel 5
Badge +25

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

Badge +1

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.

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.

Badge +2

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

 

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?

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

My next question guys

https://knowledge.safe.com/questions/117339/find-begin-or-end-of-line.html

Reply