Hi,
is there an easy way to straighten a line.
i have created a shortest route on a grid, now i want to straighten this line as it is indicated in the picture. best with 90 degree angle
thanks in advance
Hi,
is there an easy way to straighten a line.
i have created a shortest route on a grid, now i want to straighten this line as it is indicated in the picture. best with 90 degree angle
thanks in advance
In theory....
Extracting the start and end points of the feature is definitely the easiest approach. You can also accomplish this with the CoordinateExtractor, ListElementCounter and 3 VertexCreators to recreate the line with a 90 degree turn. The attached workspace might help with this if you haven't already solved it!Example 1 (highlighted is the new line):
Example 2 (highlighted is the new line):
Hi,
thank you for your support.
Your "90DegreeLineCreator" seems to be a good approach, but unfortunatly i cant use it with FME 2020 (we have this version on our server, so i have to use this one) and if i try it with 2021, then the result is not what i expected. the angle is on the wrong side, the angle must be on the same side as the origin line angle is (see attachment, blue line on the right side)
Hi @sebastiangoerck , I think you can use the NeighborFinder to find the vertex of your desired right angle corner. See the screenshot.
Hi,
thank you for your support.
Your "90DegreeLineCreator" seems to be a good approach, but unfortunatly i cant use it with FME 2020 (we have this version on our server, so i have to use this one) and if i try it with 2021, then the result is not what i expected. the angle is on the wrong side, the angle must be on the same side as the origin line angle is (see attachment, blue line on the right side)
It's possible the lines we are comparing were drawn in a different order. If you swap the coordinates in the second VertexCreator that should do the trick (essentially changing which x/y axis to align to). Try setting it to this instead:
@Takashi Iijima your solution works perfect...thank you
there are always several ways that lead to the result, for me this method is best
thank you all for your time and your support!