I have a collection of geographical points (xy coordinates) looking like this:
Collectively they follow a route with a changing direction. I am wondering if there is a way to calculate the order of these points (then label them with that order). Sort of like this:
(the blue arrow represents the overall direction of the route)
Since the direction of the route keeps changing, it is not so simple to just order by north-south or east-west (i.e. order by the y coordinate or x coordinate respectively). The change in direction needs to be accounted for. All I have thought of is treating the xy points as points on a graph, calculating a line of best fit, then using the changing gradient to find the direction, then using that value to order the points. But not sure if that is possible, or if there are better methods (if any).