简体   繁体   中英

c# order map grid coordinates

I have a list of map grid coordinates (ie34.45343,-128.24398) that constitute a road however the list is not in any order. How do I list the coordinates in order from one end to the other end? I have methods that will find the bearing and distance between two coordinates that may be beneficial to the ordering.

It's certainly possible to find the shortest route through all points in such a list, this is called the Travelling Salesman Problem. But it sounds to me like your data is not in a well-defined form. How can an unordered list describe a "road" if you don't even know whether the road goes from A to B or from C to D? Maybe the road is deliberately not the shortest possible route due to obstacles...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM