This is my input geometry
This is my desired output: I want to generate the red line.
CenterlineReplacer does not do a good job btw.
This is my input geometry
This is my desired output: I want to generate the red line.
CenterlineReplacer does not do a good job btw.
Maybe not the best, but I would try this:
Use the BoundingBoxReplacer to create a bounding box.
Then use the GeometryCoercer on both area and bounding box, to create 2 closed lines.
Then use the Intersector (Node output) to find the 2 intersection points.
Connect the 2 points to create the required straight line (2DPointConnector).
Hope this helps.
What about using centerpointreplacer and draw a line between top centerpoint and bottompoint?
Which version of FME are you using? Because the CentreLineReplacer has received some updates and fixes in recent versions. I tried this in 2019 using an approximation of your geometry, and it worked fine:
See attached workspace.
Which version of FME are you using? Because the CentreLineReplacer has received some updates and fixes in recent versions. I tried this in 2019 using an approximation of your geometry, and it worked fine:
See attached workspace.
How come the line looks so weird? It is not straight and doesn't touch the edges.
How come the line looks so weird? It is not straight and doesn't touch the edges.
Try the medial line mode. That should make it straight. Then you could do something like the Intersector, AnchoredSnapper, or LineExender to extend it to the full extents of the polygon (I've no idea why it doesn't reach that far).