Hi guys. I have set of polylines and i have to create a midpoint on midsegment of polyline. If the polyline has even number of segments it has to go on mid point of one of a two mid segments. Need help, because i cant find solution on my own!
Hi @martinsutalo
I suggest you to use the transformer CenterPointExtractor.
Â
Thanks,
Danilo
Â
Â
Hi @martinsutalo,
If the CenterPointExtractor doesn't work as you would like because the input data is Polyline I would suggest having a look at the Snipper transformer. You can set the Snipping Mode to Distance (Percentage) and then for the Starting and Ending Location parameters set this to 50. The output should then be the mid point.
Hi @martinsutalo,
If the CenterPointExtractor doesn't work as you would like because the input data is Polyline I would suggest having a look at the Snipper transformer. You can set the Snipping Mode to Distance (Percentage) and then for the Starting and Ending Location parameters set this to 50. The output should then be the mid point.
Thanks @hollyatsafe to add your comment in this case!
I tried snipper, it works if polyline has odd number of segments. If polyline has even number of segments snipper will make midpoint in one of the vertexes. In that case i would need point to be on mid point of nearest polyline segment.
I tried snipper, it works if polyline has odd number of segments. If polyline has even number of segments snipper will make midpoint in one of the vertexes. In that case i would need point to be on mid point of nearest polyline segment.
Just to clarify, if the point is located on a vertex connecting two segments, then both the neighboring segments are equally close. Or is there another criteria to decide which segment to use?
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.