Skip to main content

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

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.


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

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.


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?


Reply