Skip to main content
Question

How to get midpoint of midsegment of polyline

  • January 21, 2019
  • 6 replies
  • 336 views

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!

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • January 21, 2019

Hi @martinsutalo

I suggest you to use the transformer CenterPointExtractor.

 

Thanks,

Danilo

 

 


Forum|alt.badge.img+2
  • 719 replies
  • January 21, 2019

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.


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • January 21, 2019

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!


  • Author
  • 3 replies
  • January 21, 2019

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.


david_r
Celebrity
  • 8394 replies
  • January 22, 2019

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?


takashi
Celebrity
  • 7843 replies
  • January 22, 2019

If I understood your requirement correctly, this workflow might help you.

Result: