Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Is there a method to sequentially label a collection of geographical points that follow a route with a changing direction?

$
0
0

I have a collection of geographical points (xy coordinates) looking like this:

enter image description here

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:

enter image description here

(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).


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>