Skip to main content
Question

GOAL: Reduce multiline centerline with many branches to single, longest line


So, FME has this fabulous transformer, the "Center Line Replacer." But when you're trying to get the centerline of a lake, sometimes it doesn't work so well:

Now, I'm a reasonably smart dude, but I have yet been able to figure out how to get a single, longest distance line out of this net.

Does anyone know how?

Many thanks in advance!

Johnny

7 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • October 31, 2019

I would try using the ShortestPathFinder, using the start and end point of the desired line segment.

Hope this helps.


  • Author
  • November 1, 2019
erik_jan wrote:

I would try using the ShortestPathFinder, using the start and end point of the desired line segment.

Hope this helps.

I've tried shortest path finder, but I don't have clear start and end points. What I need to know is the length of every route across that network. It's... challenging, to say the least.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 1, 2019

In this scenario, it's not clear exactly what outcome is desirable. Something like this?

 

 


  • Author
  • November 1, 2019
ebygomm wrote:

In this scenario, it's not clear exactly what outcome is desirable. Something like this?

 

 

This is very close to what I am after, yes. The desired outcome is a line that can then be used to guide a label for the feature. So, ideally, the line would reach from one 'end' of the feature to the other, though sometimes, as in this example, there aren't clear 'ends'. A similarly problematic feature is Lac Manicouagan in Quebec, Canada, which is a round lake with a big island in the middle, though a longest route approach may work for that since the route could be infinite.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 1, 2019
jeaton wrote:

This is very close to what I am after, yes. The desired outcome is a line that can then be used to guide a label for the feature. So, ideally, the line would reach from one 'end' of the feature to the other, though sometimes, as in this example, there aren't clear 'ends'. A similarly problematic feature is Lac Manicouagan in Quebec, Canada, which is a round lake with a big island in the middle, though a longest route approach may work for that since the route could be infinite.

Something close to this can be achieved by taking all the dangling end points from the line produced by the centreline replacer, creating lines between all permutations of points, then sending these as from to lines into the shortest path finder, sending the original line as the network. You can then choose the longest of these lines.


  • Author
  • November 1, 2019
ebygomm wrote:

Something close to this can be achieved by taking all the dangling end points from the line produced by the centreline replacer, creating lines between all permutations of points, then sending these as from to lines into the shortest path finder, sending the original line as the network. You can then choose the longest of these lines.

Would this be possible for multiple features, i.e. multiple networks? Would I have to set up some sort of loop? I have not used Shortest Path Finder much, so I am unfamiliar with its mechanism.


  • Author
  • November 1, 2019
ebygomm wrote:

Something close to this can be achieved by taking all the dangling end points from the line produced by the centreline replacer, creating lines between all permutations of points, then sending these as from to lines into the shortest path finder, sending the original line as the network. You can then choose the longest of these lines.

This did help set me on the right path to finding what I needed to do. Thank you!


Reply


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