Skip to main content
Question

Remove Vertices in a polyline whose azimuth offset with adjacent line segments are within a certain tolerance


bsw-gis
Participant
Forum|alt.badge.img

Thanks to Debbi L for her help today and pointing me to:

https://community.safe.com/s/question/0D54Q00008FXAFASA5/i-have-a-100-ft-line-that-curves-and-then-turns-back-into-a-straight-line-how-can-i-use-fme-to-only-gather-the-straight-line-after-the-curve-only-i-basically-want-to-cut-out-the-curve-and-only-grab-the-line-after-the-curve 

While this helped, I am at a loss as to how to build the rest of this in order to achieve the removal of unnecessary vertices. I was hoping Generalizer would be able to do the trick but it is mainly based upon the distance between vertices. Any help would be appreciated!😉

To expand upon this, I would want to remove the vertices in the adjacent lines segments highlighted in this image:2021-10-14_20-19-37

6 replies

debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • October 15, 2021

Hi @bsw-gis​ 

You could try the LineCombiner and then a VertexRemover. Since the LineCombiner transformer only joins lines that start/end at the exact point, it would join the highlighted segments together. Then use the same VertexRemover parameters as this Q&A to keep only the start and end vertices.

sequentialSegments


danilo_fme
Evangelist
Forum|alt.badge.img+42
  • Evangelist
  • October 15, 2021
debbiatsafe wrote:

Hi @bsw-gis​ 

You could try the LineCombiner and then a VertexRemover. Since the LineCombiner transformer only joins lines that start/end at the exact point, it would join the highlighted segments together. Then use the same VertexRemover parameters as this Q&A to keep only the start and end vertices.

sequentialSegments

Nice job @debbiatsafe​ 


bsw-gis
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • October 15, 2021
debbiatsafe wrote:

Hi @bsw-gis​ 

You could try the LineCombiner and then a VertexRemover. Since the LineCombiner transformer only joins lines that start/end at the exact point, it would join the highlighted segments together. Then use the same VertexRemover parameters as this Q&A to keep only the start and end vertices.

sequentialSegments

2021-10-15_15-47-24@debbiatsafe​ this is definitely pretty slick but does have an issue. See jpg of missing segment. I included the fmwt to show the settings. Not exactly sure why that is but if the segment closed, that would likely be the solution. Any help or setting I may be missing would be appreciated! Remember, these were all polygons to start.


bsw-gis
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • October 15, 2021
bsw-gis wrote:

2021-10-15_15-47-24@debbiatsafe​ this is definitely pretty slick but does have an issue. See jpg of missing segment. I included the fmwt to show the settings. Not exactly sure why that is but if the segment closed, that would likely be the solution. Any help or setting I may be missing would be appreciated! Remember, these were all polygons to start.

I did try LineCloser just to see if it would work; it did not. However, more important would be to know why the segment is missing because in some cases there may be more than one and LineCloser would not work anyway.


bsw-gis
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • October 15, 2021

Ugh, I still had -1 on line index and that was the issue. Thanks @debbiatsafe​ 


bsw-gis
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • October 15, 2021

@debbiatsafe​ Interestingly enough, GeometryCoercer will not take the closed line and make it back into a polygon though the start and end points should be the same.


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