Question

Creating centerline from set of lines

  • 30 November 2016
  • 7 replies
  • 27 views

Badge +1

Hello everybody! I cannot find solution of this problem on forum. I have four lines next to each other and I need to create 2 centerlines between outside lines. I attach pic below. Purple ones are lines from my project and I need to create red centerlines. Any idea please?

Thanks!

Lubo


7 replies

Badge +16

Hi @lazarlubomir, the CenterLineReplacer can help, you will probably need to adjust the result for your purposes.

Hope this helps.

Badge +1

Hi @lazarlubomir, the CenterLineReplacer can help, you will probably need to adjust the result for your purposes.

Hope this helps.

@itay Yes, thank you! Anyway, CenterLineReplacer works only with polygon input, not with line input. So I need to know, if there is possibility to convert lines to polygons. And if create polygons, how can I reach to create polygons only from outside lines?

 

Badge +16
@itay Yes, thank you! Anyway, CenterLineReplacer works only with polygon input, not with line input. So I need to know, if there is possibility to convert lines to polygons. And if create polygons, how can I reach to create polygons only from outside lines?

 

The AreaBuilder is the transformer for area creation from (well connected) lines. Seems to me like you first need to select which lines should be transformed into polygons. How to go about that is dependent on your input.

 

Userlevel 5
Badge +25

This is slightly trickier than just a CenterlineReplacer, but I solved it (at least for a simple test case) by generating buffers for my lines, using the Bufferer with a buffer size slightly larger than the maximum distance between parallel lines. Then do an AreaOnAreaOverlayer and count the overlaps, 2 overlapping buffers is what we're looking for, generating a centerline from that yields a more or less useful result, again in my simple test case.

centerline.fmw

Badge +1

This is slightly trickier than just a CenterlineReplacer, but I solved it (at least for a simple test case) by generating buffers for my lines, using the Bufferer with a buffer size slightly larger than the maximum distance between parallel lines. Then do an AreaOnAreaOverlayer and count the overlaps, 2 overlapping buffers is what we're looking for, generating a centerline from that yields a more or less useful result, again in my simple test case.

centerline.fmw

@redgeographics Really great tip, thank You! But what if distance between all lines is the same?

 

Badge +3

check similar angle and closest neighbour. (if there is no data relation)

Matches can be grouped,.

Groups can be Bounding box Replaced, oriented.

From Bounding boxes extract centerline, which is easy math or easy for the centerline replacer.

For complex objects, more complex solutions required.

Userlevel 5
Badge +25
@redgeographics Really great tip, thank You! But what if distance between all lines is the same?

 

Then you might be in trouble, however, if there's an attribute or combination of attributes that ties certain lines together you can use that as a Group By in the AreaOnAreaOverlayer.

 

 

Reply