Question

Find Line Order within a line dataset

  • 25 November 2015
  • 6 replies
  • 17 views

hi, I'm trying to establish the order of line features within a line dataset so i can apply an sequential ID in the direction of travel. All line are snapped together with the exception of the start of the first line and end of the last line. I have attempted to use CoordinateExtractor and NeighbourFinder but as the line doubles back on itself (but doesn't self intersect) the numbering is sometimes out of sequence along the line itself. I feel like this should be a fairly struighforward task but i am currently flummoxed! Many thanks!

6 replies

Userlevel 5
Badge +25
I'm not sure whether I completely understand the problem, but here goes: FME reads the features in the order in which they're in the original dataset. So if they are in the correct order there FME will read them in the correct order. Then to assign a sequential ID you can use the Counter. Hope this helps.
Userlevel 2
Badge +17
Hi, the LineJoiner and PathSplitter might help you.
  1. LineJoiner - List Name: _list, Preserve lines as Path Segments: Yes
  2. PathSplitter - Segment Number Attribute: _segment_number, List Attribute: _list{}
You can use the Segment Number Attribute (or +1) as required sequential ID. Takashi
Userlevel 2
Badge +17
Hi, the LineJoiner and PathSplitter might help you.
  1. LineJoiner - List Name: _list, Preserve lines as Path Segments: Yes
  2. PathSplitter - Segment Number Attribute: _segment_number, List Attribute: _list{}
You can use the Segment Number Attribute (or +1) as required sequential ID. Takashi

It may also be necessary to set "yes" to the Preserve Original Orientation of the LineJoiner.

Badge +3
Or just a topology builder and use the node number attribute it creates? ..For a single set of lines. (some relation) For multiple sets you need to relate the touching ones and set an id per set. Then you can use topologybuilder with group by id and use nodenumber.
Badge +3
..wich latter requires more tranformers than joining, preserve path and splitting...
Hi, the LineJoiner and PathSplitter might help you.
  1. LineJoiner - List Name: _list, Preserve lines as Path Segments: Yes
  2. PathSplitter - Segment Number Attribute: _segment_number, List Attribute: _list{}
You can use the Segment Number Attribute (or +1) as required sequential ID. Takashi

Thanks! Worked a treat, just what i was looking for.

Reply