Question

Sort point features by distance between each other

  • 9 April 2021
  • 1 reply
  • 6 views

Badge

I have a bunch of points features in input and I would like to sort them by distance between each other so the next row in the excel sheet in output would be the point the closest to the previous row.

 

How can I achieve that with FME?


1 reply

Userlevel 1
Badge +11

Hi @bgeorges​ You can get the distance between features with the NeighborFinder transformer. However, the distance between the two closest features will be the same - so which comes first? Sorting by those distances will group points in pairs. I've attached a workspace which demonstrates this but also a second method of finding the two closest points and then sorting by the sum of those two distances.

Reply