Skip to main content

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.

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!


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.


@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?


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​  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.


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


@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


Reply