Skip to main content
Question

How to get midpoint of midsegment of polyline

  • January 21, 2019
  • 6 replies
  • 271 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!

6 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • January 21, 2019

Hi @martinsutalo

I suggest you to use the transformer CenterPointExtractor.

 

Thanks,

Danilo

 

 


Forum|alt.badge.img+2

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
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • January 21, 2019
hollyatsafe wrote:

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.


david_r
Celebrity
  • January 22, 2019
martinsutalo wrote:

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
Influencer
  • January 22, 2019

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

Result:


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings