Question

To identify and repair self closing lines

  • 28 March 2023
  • 7 replies
  • 16 views

Badge

After LineJoiner some lines are joining in the way of making self closing line geometry with start and the end point in the same spot.

Is there the way to identify and repair such lines or maybe there is option in LineJoiner to avoid such situations?


7 replies

Userlevel 2
Badge +12

Did you have a look at the Break Loops parameter of the LineJoiner?

Badge

Did you have a look at the Break Loops parameter of the LineJoiner?

Break Loops parameter is set to "Yes" .

Userlevel 2
Badge +12

This parameter indicates whether any resulting (or input) closed rings should ever be broken into two segments:

  • If you choose Yes and the input data contained a set of lines that formed a ring and did not interact with any other lines, no closed ring will be formed and the two lines will be returned, broken at two arbitrary end vertices of the original input.
  • If you choose No, then if a set of lines independent from any other set of lines would form a ring, they will be connected into a single linear feature whose start and end point is the same. The feature will be considered as having a geometry type of line and not polygon (however, you could use the LineCloser to promote its geometry type to polygon).

 

So, in your case, loops should be broken and no self closing lines should be present, right?

Userlevel 1
Badge +21

What do you mean by repair such lines? What would you want to happen instead? The features remain as lines

Badge

This parameter indicates whether any resulting (or input) closed rings should ever be broken into two segments:

  • If you choose Yes and the input data contained a set of lines that formed a ring and did not interact with any other lines, no closed ring will be formed and the two lines will be returned, broken at two arbitrary end vertices of the original input.
  • If you choose No, then if a set of lines independent from any other set of lines would form a ring, they will be connected into a single linear feature whose start and end point is the same. The feature will be considered as having a geometry type of line and not polygon (however, you could use the LineCloser to promote its geometry type to polygon).

 

So, in your case, loops should be broken and no self closing lines should be present, right?

Thanks for an answer.

Original data topology situation close-up looks like in a picture below.

Two lines crosses each other and not reached the next line.

LineJoiner joins those two lines making new vertex point, with parameter Input FeatureTopology set to "End noded".

 

selfclosing line_originaldata

Badge

What do you mean by repair such lines? What would you want to happen instead? The features remain as lines

The goal is to avoid loops.

If two lines are touching each other and joining them makes a loop, lines should not be joined. LineJoinerParameter Brake loops: YES didn`t work for this one.

So after that, maybe there is any way to identify loops, at first.

After repai result must looks like in picture below -

lines_WouldBe

Badge

This parameter indicates whether any resulting (or input) closed rings should ever be broken into two segments:

  • If you choose Yes and the input data contained a set of lines that formed a ring and did not interact with any other lines, no closed ring will be formed and the two lines will be returned, broken at two arbitrary end vertices of the original input.
  • If you choose No, then if a set of lines independent from any other set of lines would form a ring, they will be connected into a single linear feature whose start and end point is the same. The feature will be considered as having a geometry type of line and not polygon (however, you could use the LineCloser to promote its geometry type to polygon).

 

So, in your case, loops should be broken and no self closing lines should be present, right?

I tried FME 2021.2.6. version, LineCombiner with Break on Loops parmeter YES, but same as for older FME transformer LineJoiner, in my case about avoiding loops, helps to set Preserve orientation parameter to YES. Of couse it`s increasing amount of unjoined lines, what is no good.

LineCombiner_loops

Reply