Question

Merge adjacent colinear segments into one

  • 22 April 2021
  • 1 reply
  • 24 views

Badge +1

Hello FMEers !

 

I am struggling with a specific issue : for various reasons, I applied a very small buffer on a set of lines (IFMEMultiCurve), just to apply a CenterLineReplacer right after (on "Approximate Center Line" mode) . By doing so, I was hoping to get rid of geometry issues, but in the end, I am getting some brand new issues !

On some portions of the resulting lines are actually many small segments which are (or seem) colinear :many_segmentsIt also seems that some segments have a lengh of 0 : starting and ending points have the exact same coordinates.

Is it possible to avoid this kind of side effects ?

Or to fix the kind of issues ? I don't care about the global line direction, and merging some not-perferctly-colinear segments would not be a problem.

(I tried some LineOnLineOverlayer, Matcher, LineCombiner, but none of them seem to do what I want.)

 

Here is a geojson file resulting from such process : [file] (link is valid for a month)

 

Thanks in advance ! 😃


1 reply

Badge +2

@mickael​ Thanks for including the GeoJSON sample data.

I don't see any separate points in the GeoJSON, but the vertices on the line are very close together. You can thin out the data using the Generalizer. If you want to recover the arcs on the roundabouts and cul de sacs, you can experiment with CurveFitter (used to be an extra cost plugin but is not free in FME 2020 or higher).

 

You might want to reproject from your geographic coordinate system to a projected coordinate system when using these transformers since they work in the units of the current projection

Reply