Skip to main content
Question

Proper centerline between two lines

  • September 1, 2020
  • 7 replies
  • 297 views

fikusas
Contributor
Forum|alt.badge.img+5

There are two lines and I need proper centerline between them. Approximate gives good results at the ends, but fails in some corners. Medial Axis fixes the corner issue, but messes up the ends (shortens them) and makes unnecessary additional lines.

Is it possible to get the mix of both: medial axis with proper length ends and without additional line segments?

For reference, see the attached pics. Workflow is:

  1. Make buffers from lines (end caps: square, corner: mitter);
  2. Dissolve buffers;
  3. Use CenterLineReplacer.

7 replies

kailinatsafe
Safer
Forum|alt.badge.img+21

Hello @fikusas​ ,

Have you tried using the Densifier transformer to add vertices? More vertices may increase the accuracy of the CenterlineReplacer. Let me know if this helps!


  • September 11, 2020

Hi,

I've worked on something similar and used a combination of Snippers, counter and LineBuilder to get the job done.

Snipper let you produce vertices at an interval on both lines, you can play with the value here for precision. After that, I was giving an ID with the counter to group vertices on both lines together

Then I create a line with the LineBuilder grouped on those ID (making perpendicular lines). Then use the snipper with a 50% value and finally build a line with all those points.


Forum|alt.badge.img+2
  • September 11, 2020

@fikusas​  FME 2019 had a good overhaul of CenterlineReplacer, so make sure you are using FME 2019 or later. As @kailinatsafe​  suggests, adding a few extra points with Densifier before the Bufferer and making your Buffer Distance as small as you can might also help. Would you be able to share a small sample of the data?


fikusas
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 15, 2020
alexist wrote:

Hi,

I've worked on something similar and used a combination of Snippers, counter and LineBuilder to get the job done.

Snipper let you produce vertices at an interval on both lines, you can play with the value here for precision. After that, I was giving an ID with the counter to group vertices on both lines together

Then I create a line with the LineBuilder grouped on those ID (making perpendicular lines). Then use the snipper with a 50% value and finally build a line with all those points.

Can you share a sample workspace?


fikusas
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 15, 2020
markatsafe wrote:

@fikusas​  FME 2019 had a good overhaul of CenterlineReplacer, so make sure you are using FME 2019 or later. As @kailinatsafe​  suggests, adding a few extra points with Densifier before the Bufferer and making your Buffer Distance as small as you can might also help. Would you be able to share a small sample of the data?

I'm using FME 2020. Densifier doesn't do much in this case. See the attached workspace below.


arnovananrooij
Contributor
Forum|alt.badge.img+5

I tried the densifier and chopper. Together it fixes your problem. See the attached workspace.


Forum|alt.badge.img+2
  • September 15, 2020

@fikusas​ You could try AreaOnAreaOverlayer instead of Dissolver (test for _overlaps >1) This will limit the CenterLineReplacer to a narrower band to work with and might give a more consistent result:

2020-09-15_11-19-47


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