Skip to main content
Solved

I have a line that I need to cut segments out of, based on to and from points that share a common attributes.

  • January 17, 2020
  • 4 replies
  • 408 views

daveapegg
Contributor
Forum|alt.badge.img+4

Hi guys,

I have a line file (1 line) and a point file (Multiple pairs of start/end points). I'm trying to clip multiple line segments from a single line based on a start and end points with matching ID attribute. I have been trying PointOnLineOverlayer but it adds the attributes from only the first point to every line. When I generate a list based on the ID the list includes every point ID on every line, not just the points that the new line intersects.

 

Is there another way to achieve this?

Any help would be greatly aprreciated.

Cheers, Dave.

Best answer by bwn

Use TopologyBuilder or Intersector.

TopologyBuilder will output the split lines on the "Edges" port. Each of these edges will have the intersecting Start and End Points in the "_Nodes{}" List that is generated for each Edge. This List will also contain the original Point attributes if set the Parameter "Propogate all Attributes from Input" to "Yes"

To find split lines that have the same Start and Stop Group ID is just then using a Tester on the Edges ouput port from TopologyBuilder: Where _Nodes{0}.GroupID = _Nodes{1].GroupID (assuming there should only be ever 2 Nodes per Edge),

For TopologyBuilder, the best results can be achieved by first snapping the Points to the Line with AnchoredSnapper in Segment Snapping mode, with the Lines as the "Anchor". This will add any missing intermediate vertices to the lines where the Points intersect, or come close to intersecting the line. Then feeding the Anchors Output (now with any new vertices required added to the original line that have the same X,Y as the snapped Points), and also sending the Snapped Points to TopologyBuilder into the same Input Port, it can be run with a Tolerance of 0 and "Assume Clean Data" = "Yes".

Depending on how TopologyBuilder is used and FME version, you may also need to split the lines between the AnchoredSnapper and TopologyBuilder with a PointOnLineOverLayer first to get a Line End-to-Line End initial Topology to feed into TopologyBuilder, but I think as long as there are Points intesecting on Line vertices, it should split the lines within the ToplogyBuilder transformer without needing to do this (haven't tested).

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

4 replies

bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • Best Answer
  • January 17, 2020

Use TopologyBuilder or Intersector.

TopologyBuilder will output the split lines on the "Edges" port. Each of these edges will have the intersecting Start and End Points in the "_Nodes{}" List that is generated for each Edge. This List will also contain the original Point attributes if set the Parameter "Propogate all Attributes from Input" to "Yes"

To find split lines that have the same Start and Stop Group ID is just then using a Tester on the Edges ouput port from TopologyBuilder: Where _Nodes{0}.GroupID = _Nodes{1].GroupID (assuming there should only be ever 2 Nodes per Edge),

For TopologyBuilder, the best results can be achieved by first snapping the Points to the Line with AnchoredSnapper in Segment Snapping mode, with the Lines as the "Anchor". This will add any missing intermediate vertices to the lines where the Points intersect, or come close to intersecting the line. Then feeding the Anchors Output (now with any new vertices required added to the original line that have the same X,Y as the snapped Points), and also sending the Snapped Points to TopologyBuilder into the same Input Port, it can be run with a Tolerance of 0 and "Assume Clean Data" = "Yes".

Depending on how TopologyBuilder is used and FME version, you may also need to split the lines between the AnchoredSnapper and TopologyBuilder with a PointOnLineOverLayer first to get a Line End-to-Line End initial Topology to feed into TopologyBuilder, but I think as long as there are Points intesecting on Line vertices, it should split the lines within the ToplogyBuilder transformer without needing to do this (haven't tested).


daveapegg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • January 17, 2020
bwn wrote:

Use TopologyBuilder or Intersector.

TopologyBuilder will output the split lines on the "Edges" port. Each of these edges will have the intersecting Start and End Points in the "_Nodes{}" List that is generated for each Edge. This List will also contain the original Point attributes if set the Parameter "Propogate all Attributes from Input" to "Yes"

To find split lines that have the same Start and Stop Group ID is just then using a Tester on the Edges ouput port from TopologyBuilder: Where _Nodes{0}.GroupID = _Nodes{1].GroupID (assuming there should only be ever 2 Nodes per Edge),

For TopologyBuilder, the best results can be achieved by first snapping the Points to the Line with AnchoredSnapper in Segment Snapping mode, with the Lines as the "Anchor". This will add any missing intermediate vertices to the lines where the Points intersect, or come close to intersecting the line. Then feeding the Anchors Output (now with any new vertices required added to the original line that have the same X,Y as the snapped Points), and also sending the Snapped Points to TopologyBuilder into the same Input Port, it can be run with a Tolerance of 0 and "Assume Clean Data" = "Yes".

Depending on how TopologyBuilder is used and FME version, you may also need to split the lines between the AnchoredSnapper and TopologyBuilder with a PointOnLineOverLayer first to get a Line End-to-Line End initial Topology to feed into TopologyBuilder, but I think as long as there are Points intesecting on Line vertices, it should split the lines within the ToplogyBuilder transformer without needing to do this (haven't tested).

Thank very much! This worked perfectly. It missed a few segments but I think that's more my data than the process.


Forum|alt.badge.img+2
  • January 17, 2020

@daveapegg Looks like @bwn has given you a good solution. The Snipper transformer can also be helpful for these types of problem. Build Topology and Calculate Route Length


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • January 17, 2020

Another option could be using the ShortestPathFinder transformer to find the path between the start and end points.


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