Question

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

  • 15 October 2021
  • 6 replies
  • 4 views

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

Userlevel 3
Badge +17

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

Userlevel 4
Badge +30

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​ 

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.

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.

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

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

Reply