Skip to main content
Solved

Break Line into Segments and Assign Sequential Order Attribute from Start


Forum|alt.badge.img

Hi,

I would like to break a line into segments and then assign a sequential order attribute starting at the start of the line.

For example, in my screenshot, if I break the line into 500m segments, I would like section 1 to go from the start point to 500m, section 2 to go from 500m to 1000m, and so on to the end of the line.

I've tried using the iterative snipper and the chopper to break the line but the problem is that they both output the line segments in a random order.

Would anyone know how I might do this?

Thanks.

 

Best answer by ebygomm

You need to decide what to do with these two parts.

If you deaggregate the multicurve and drop these two parts, you can then recombine to form a single line which you can use the iterative snipper on, and the parts will come out in order

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

10 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • June 4, 2020

The lines coming out the iterative snipper should come out in the correct order so it is odd that they don't. Is the line as single line, or is it a multipart geometry/path?

You could set a measure on the line using a measuregenerator, then use a measureextractor to get the measure at the start point of each snipped line which you could then use to order the lines


Forum|alt.badge.img
  • Author
  • June 4, 2020
ebygomm wrote:

The lines coming out the iterative snipper should come out in the correct order so it is odd that they don't. Is the line as single line, or is it a multipart geometry/path?

You could set a measure on the line using a measuregenerator, then use a measureextractor to get the measure at the start point of each snipped line which you could then use to order the lines

I double checked and it is in fact a multipart geometry/ path and not a single line after all.

Do you think it's still doable?


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • June 4, 2020
smcd84 wrote:

I double checked and it is in fact a multipart geometry/ path and not a single line after all.

Do you think it's still doable?

Is it a IFMEPath or an IFMEMultiCurve or something else? The iterative snipper will not treat aggregate geometries as a single line


Forum|alt.badge.img
  • Author
  • June 4, 2020
ebygomm wrote:

Is it a IFMEPath or an IFMEMultiCurve or something else? The iterative snipper will not treat aggregate geometries as a single line

It's an IFMEMultiCurve.

Will another approach work?


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • June 4, 2020
smcd84 wrote:

It's an IFMEMultiCurve.

Will another approach work?

Are you able to share the geometry? It may be that it is a multicurve but could be converted to a path. If they're actually discrete line segments then you need to decide how you would want them to be snipped, since the logic of every 500m does not work if they're actually separate lines.


Forum|alt.badge.img
  • Author
  • June 4, 2020
ebygomm wrote:

Are you able to share the geometry? It may be that it is a multicurve but could be converted to a path. If they're actually discrete line segments then you need to decide how you would want them to be snipped, since the logic of every 500m does not work if they're actually separate lines.

I can share. Here it is as a .shp.

ifmemulticurve.zip


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • Best Answer
  • June 4, 2020

You need to decide what to do with these two parts.

If you deaggregate the multicurve and drop these two parts, you can then recombine to form a single line which you can use the iterative snipper on, and the parts will come out in order


Forum|alt.badge.img
  • Author
  • June 4, 2020
ebygomm wrote:

You need to decide what to do with these two parts.

If you deaggregate the multicurve and drop these two parts, you can then recombine to form a single line which you can use the iterative snipper on, and the parts will come out in order

Of course!

Thank you for your help.


Forum|alt.badge.img+2

@smcd84 It seems that IterativeSnipper should have a segment count, so I've modified it in this workspace (FME 2020): iterativesnipperexample.fmwt

As @ebygomm suggests, you'll have to deaggregate and then LineCombine your IFMEMultiCurve for that to work.


Forum|alt.badge.img
  • Author
  • June 5, 2020
markatsafe wrote:

@smcd84 It seems that IterativeSnipper should have a segment count, so I've modified it in this workspace (FME 2020): iterativesnipperexample.fmwt

As @ebygomm suggests, you'll have to deaggregate and then LineCombine your IFMEMultiCurve for that to work.

Excellent. Thank you.


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