Skip to main content
Question

Overlapping lines with priority


clowncutie
Contributor
Forum|alt.badge.img+7

I have been checking a lot on this link but its not exactly what I want. 

Combine overlapping/touching lines into one long simple geometric line | Community

I have one geopackage with lines of different types that overlap, 2 attribute types, the blue type and the red. As you can see they overlap.

I want the red lines to take priority, meaning where the red lines are the underlying blue lines should be remove so I only have 1 layer of polygons with the 2 types. Note that the length of the blue line doesn’t always match the length of the red so the underlying blue line have to be cut. I have filtrered them, tried line combiner, line on line overlay which generates INVALID_POLYGON_GEOMETRY_VERTICES error. 

 

  1. Reader polylines with attributes
  2. TestFilter, filters and splits the 2 types I want based on the type name
  3. ???
  4. Before reader im gonna do a snapper since dataset have some gaps some of the read doesnt reach the entire way to the blue in some instances. 

 

Result example (also want snapper in the circle area so the gap is fixed but think I figured that out. )

 

ctredinnick
Supporter
Forum|alt.badge.img+18

If you are getting INVALID_POLYGON_GEOMETRY_VERTICES, then either filter out areas (GeometryFilter), or turn them into lines (GeometryCoercer).

For the overlap, LineOnLineOverlayer should do the trick. You can either enable the option to ‘Separate Colinear Segments’, and follow that with a tester excluding all blue lines with an overlap. Or, set Accumulation Mode to Use From One, and use a FeatureHolder on the blue lines to ensure that they arrive in second and are not preferentially chosen.

You may need to snap the features all together either before or after the overlay, it depends on the sorts of gaps/misalignments you need to correct.


cosminciotina
Contributor
Forum|alt.badge.img+3

My suggestion.

1. Use a filter to separate the red lines and blue line (if the lines are on the same layer).
2. For the red lines create a buffer with a width that cover all the blue lines and the End cap style to be set as "None"
3. Use a clipper to clip the blue lines that are inside of the buffer polygons of the red lines. 
4. Use Snapper Transformer to connect the lines with gaps.


clowncutie
Contributor
Forum|alt.badge.img+7
  • Contributor
  • January 28, 2025
ctredinnick wrote:

If you are getting INVALID_POLYGON_GEOMETRY_VERTICES, then either filter out areas (GeometryFilter), or turn them into lines (GeometryCoercer).

For the overlap, LineOnLineOverlayer should do the trick. You can either enable the option to ‘Separate Colinear Segments’, and follow that with a tester excluding all blue lines with an overlap. Or, set Accumulation Mode to Use From One, and use a FeatureHolder on the blue lines to ensure that they arrive in second and are not preferentially chosen.

You may need to snap the features all together either before or after the overlay, it depends on the sorts of gaps/misalignments you need to correct.

unfortunetaly it still says invalid and rejected the transformer

 


clowncutie
Contributor
Forum|alt.badge.img+7
  • Contributor
  • January 28, 2025
ctredinnick wrote:

If you are getting INVALID_POLYGON_GEOMETRY_VERTICES, then either filter out areas (GeometryFilter), or turn them into lines (GeometryCoercer).

For the overlap, LineOnLineOverlayer should do the trick. You can either enable the option to ‘Separate Colinear Segments’, and follow that with a tester excluding all blue lines with an overlap. Or, set Accumulation Mode to Use From One, and use a FeatureHolder on the blue lines to ensure that they arrive in second and are not preferentially chosen.

You may need to snap the features all together either before or after the overlay, it depends on the sorts of gaps/misalignments you need to correct.

I forced into a fme line but still get this


Reply


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