Skip to main content
Question

Advanced xyz sorting


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

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+19
jeroenstiers wrote:

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
Influencer
  • 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
Forum|alt.badge.img+9

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?


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