Skip to main content
Question

Advanced xyz sorting

  • March 1, 2017
  • 4 replies
  • 34 views

Forum|alt.badge.img

Hi all, I am trying to sort points from tunnel cross section based on their geography so that I can create cross section lines. Anyone have an idea for a approach? See image

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.

4 replies

Forum|alt.badge.img+7

Hi @hrinze

The way to to the sorting in this particular case is by taking one of the points located at the end / start. Starting there you will have to keep finding the closest point that is not yet processed until all the points are linked.

I would suggest to implement this functionality in Python since it will be cleaner than using a looping custom transformer.


verdoodtdries
Supporter
Forum|alt.badge.img+23

Hi @hrinze

The way to to the sorting in this particular case is by taking one of the points located at the end / start. Starting there you will have to keep finding the closest point that is not yet processed until all the points are linked.

I would suggest to implement this functionality in Python since it will be cleaner than using a looping custom transformer.

@hrinze

 

For this issue, the Python API can be a useful resource:

 

! https://docs.safe.com/fme/html/FME_Objects_Python_API/index.html

takashi
Celebrity
  • March 3, 2017

Hi @hrinze, if the points are always aligned along an approximate arc like your screenshot, it might be possible to sort them by the angle of line segment connecting each point and the center of the cross section. e.g.


roland.martin
Contributor
Forum|alt.badge.img+11

I'd probably try a concave hull (in the HullAccumulator) as a starting point - it's hacky, but might give you the answer you're looking for anyway.

Once you've got that, you could possibly output the HullAccumulator to a Chopper or a Snipper on a fine setting (followed by a Counter if it's needed?) and then use a NeighborFinder to join your original points to their nearest concave hull point, thereby giving you a sequence?