@sraapril
You could
Chopp the lines by 2vertices. Create an unique ID on these. Extract orientation.
Extract begin and end coordinates.
Create a attribute RoundeCoord=@round(coord,6)
Create a list grouped by this latter attribute.
Test for listelementcount = 3. That your fork.
Compare angles within the group. Angles with a separation in (min,max) separation dictate fork direction.
Between the 2 within the separation angle, the lower angle is the right side if in 2nd and 3rd quadrant. The other two quadrant is revers.
do you have sampledata for us? (one in image is very suitable)
@sraapril
You could
Chopp the lines by 2vertices. Create an unique ID on these. Extract orientation.
Extract begin and end coordinates.
Create a attribute RoundeCoord=@round(coord,6)
Create a list grouped by this latter attribute.
Test for listelementcount = 3. That your fork.
Compare angles within the group. Angles with a separation in (min,max) separation dictate fork direction.
Between the 2 within the separation angle, the lower angle is the right side if in 2nd and 3rd quadrant. The other two quadrant is revers.
do you have sampledata for us? (one in image is very suitable)
Hi @gio.
Thank you! The orientation extractor always returns no orientation.
When you mean list, do you mean the 3 coordinate list of the fork? After I get the three coordinates, how do I calculate the angles?
Polyline analyzer, Vertex Angle Calculator, I mean nothing gives me any value 😞
The image I posted above is the best sample dataset. I have attached a shapefile of the same.
TRACK_DATA.zip
I would use a topologyBuilder.
Test the nodes for those containing three elements.
Subtract the _node_angle{}.fme_arc_angles from one another, if the difference is more than 180 use the explementary angle (360-angle)
The smallest difference in angles correspond to your forks. The third line is your lead-in.
Since the _node_angle list is always ordered counterclockwise, the next index after your lead in (wrapping to 0 if the lead in is 2) is the right segment.
@sraapril
Hi,
I made a workbench doing it.
I did it slightly different form what I posted before.
Difference is I use Topologybuilder and snipper (rather then chopper).
I'll post it here and hope you can download it.
sraapril_forum.fmw
@sraapril
Here is annotated pic of the workbench.
It is built for "binary" branching.
If you have switches with more then 2 branches, the section between the testfilter and the listexploder need to be adapted. (at which point you have to create something like "from_left_to_right numbering")
Here is an alternative workspace based on my workflow. The size of the switches is hardcoded, but could easily be parameterized. It is also adaptable to have the left and right assigned to the original line features, but that would require 2 feature mergers, one for the start of the line (from_node) and one for the end of the line (to_node).
sideFork.fmwt