Skip to main content
Question

Splitting Linear Referencing Segment and assign a Value to First Segment


Forum|alt.badge.img

I am new to FME, and I am trying to set up a workflow to transform some LRS segment feature data using the following rule: Assume that each feature segment has route identifier, begin and end measure, and a "split key" which is a value that indicates a percentage of the total segment length that I should split the event in TWO. I think this can be done with the Clipper transformer.

In addition however, I have another requirement where when I split the event into 2, I need to add a new value to the first segment only. This is what is tripping me up. After splitting the segment, how do I identify the first of the 2 splits and add the value. If my explanation is not clear enough, see the following example data

INPUT: Given the following example Event Segments: ROUTE_IDBEGIN_MEASUREEND_MEASURESPLIT_KEYR1 0520%R23950%R2912100%

 

OUTPUT: ROUTE_IDBEGIN_MEASUREEND_MEASURE

NEW_ATTR

R101AR115nullR236AR2612nullR2912A Note that in the last segment, a split of 100% yields the same segment so there is only one segment in the resulting split list. Anyway, I am open to suggestions.

 

Thanks, Tom

3 replies

Forum|alt.badge.img
  • Author
  • July 19, 2017
I figured out how to do this. Just use the cloner and read the "Copy Number Attribute" to decide which new Feature to add the NEW_ATTR value to. Use the Snipper transformer to resize segments.

 


takashi
Influencer
  • July 19, 2017

Alternatively, you can send the feature to a Snipper at first, then add NEW_ATTR = A to the Output feature, and add NEW_ATTR = <null> to the Remnants feature.

Snipper Parameters

  • Snipping Mode: Distance (Percentage)
  • Starting Location: 0
  • Ending Location: SPLIT_KEY

Forum|alt.badge.img
  • Author
  • July 20, 2017
takashi wrote:

Alternatively, you can send the feature to a Snipper at first, then add NEW_ATTR = A to the Output feature, and add NEW_ATTR = <null> to the Remnants feature.

Snipper Parameters

  • Snipping Mode: Distance (Percentage)
  • Starting Location: 0
  • Ending Location: SPLIT_KEY
Thanks, didn't see that in the Snipper...another handy 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