Closed Thread
Results 1 to 19 of 19

How to sort GPS coordinates within a range?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-21-2017
    Location
    Boston, MA, USA
    MS-Off Ver
    2013
    Posts
    5

    How to sort GPS coordinates within a range?

    I have Longitude and Latitude GPS data and want to sort them within a specified Lat/Long range so they are sorted in shortest distance sequence within that range? I searched several sites but can't find any useful solutions. Anyone here have any pointers? Any help is much appreciated.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,979

    Re: How to sort GPS coordinates within a range?

    Welcome to the forum!

    Give us some example data: what you have got and how you want it sorting.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-21-2017
    Location
    Boston, MA, USA
    MS-Off Ver
    2013
    Posts
    5

    Re: How to sort GPS coordinates within a range?

    Below is a data example, each LAT/LONG combination is a point location. So I want to set a starting location, i.e. 44.133248 / -69.091775 and than want to sort the data so it shows the next closest GPS location (let's call it 'Point 1' for this example)from the starting point and the next sorted GPS location should be the closest distance from 'Point 1' and so forth. I basically want to sort the data in a way that shows me sequentially the shortest distance from one point to the next. I hope this makes sense?

    Latitude Longitude
    44.119731 -69.108058
    44.119731 -69.108057
    44.119731 -69.108056
    44.119731 -69.108055
    44.119731 -69.108054
    44.119731 -69.108053
    44.119731 -69.108052
    44.119731 -69.108051
    44.104613 -69.07741
    44.104613 -69.077409
    44.104613 -69.077408
    44.104613 -69.077407
    44.104613 -69.077406
    44.104613 -69.077405
    44.104613 -69.077404
    44.104613 -69.077403
    44.104613 -69.077402
    44.104613 -69.077401

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to sort GPS coordinates within a range?

    You want the shortest circuit that visits each point?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    07-21-2017
    Location
    Boston, MA, USA
    MS-Off Ver
    2013
    Posts
    5
    Quote Originally Posted by shg View Post
    You want the shortest circuit that visits each point?
    Yes, have close to 1000 points but different starting points and want to sort them shortest circuits from where I start

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to sort GPS coordinates within a range?

    Google Traveling Salesman Problem. It's famous enough that you can just google TSP.

  7. #7
    Registered User
    Join Date
    07-21-2017
    Location
    Boston, MA, USA
    MS-Off Ver
    2013
    Posts
    5

    Re: How to sort GPS coordinates within a range?

    Thank you very much. Looks like a rather interesting formula!
    Any idea how to add the GPS data into cells so it recognizes it as a GPS point?

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to sort GPS coordinates within a range?

    >> Looks like a rather interesting formula!

    What formula are you referring to?

    >> Any idea how to add the GPS data into cells so it recognizes it as a GPS point?

    Dunno what you mean by a "GPS point". Latitude and longitude are clear enough.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to sort GPS coordinates within a range?

    The attachment does what you asked. It uses a (plate carrée) approximation to great-circle distance.

    Press the Random button, then the Sort button. It's entertaining to watch.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    07-21-2017
    Location
    Boston, MA, USA
    MS-Off Ver
    2013
    Posts
    5

    Re: How to sort GPS coordinates within a range?

    This is pretty darn awesome. Really cool to watch.
    Thank you very very much. This would have taken me a very long time, if I would have been able to do it. I can't tell you how much this help!

    Thanks again!!!

  11. #11
    Registered User
    Join Date
    11-01-2017
    Location
    Grande Prairie, Alberta, Canada
    MS-Off Ver
    Windows 7
    Posts
    1

    Unhappy Re: How to sort GPS coordinates within a range?

    I am not an expert in excel at all. I can get by if I need to do a spreadsheet. I too have a whole bunch of GPS Coordinates that I need to sort with distance. I have downloaded and saved the spreadsheet attached to this string, however when I put my own GPS Coordinates into it - it does not save them after I hit sort. It reverts to the original set of coordinates that were in the spreadsheet. I find that this spreadsheet will be soooooo helpful for what I need to do. Please help

  12. #12
    Registered User
    Join Date
    05-15-2019
    Location
    indonesia
    MS-Off Ver
    office 2016
    Posts
    1

    Re: How to sort GPS coordinates within a range?

    hi, I am new member here and very interested with this topic.
    I Wonder if there is any way to save this sorted routes as kml files so that I could upload them into Google my maps.
    Been using my maps since months a go. Thank you for you help.

  13. #13
    Registered User
    Join Date
    06-13-2019
    Location
    USA
    MS-Off Ver
    365
    Posts
    1

    Re: How to sort GPS coordinates within a range?

    I have a similar problem, to sort (x,y) point to form an enclosed region. Data is:
    1.00E-02 2.53E-02
    1.00E-02 2.64E-02
    1.05E-02 2.54E-02
    1.10E-02 2.55E-02
    1.15E-02 2.55E-02
    1.20E-02 2.56E-02
    1.00E-02 0.23272025
    1.00E-02 0.2407863
    1.26E-02 2.57E-02
    1.05E-02 0.24067432
    1.10E-02 0.24050646
    1.32E-02 2.58E-02
    1.15E-02 0.24039461
    1.38E-02 2.59E-02
    1.20E-02 0.24022694
    1.45E-02 2.60E-02
    1.26E-02 0.24011522
    1.52E-02 2.61E-02
    1.32E-02 0.23994774
    1.59E-02 2.62E-02
    1.38E-02 0.23978038
    1.45E-02 0.23961313
    1.66E-02 2.63E-02
    1.52E-02 0.23939032
    1.74E-02 2.64E-02
    1.79E-02 2.64E-02
    1.59E-02 0.23922335
    1.83E-02 2.65E-02
    1.66E-02 0.23905649
    1.91E-02 2.66E-02
    1.74E-02 0.2388342
    2.00E-02 2.67E-02
    1.83E-02 0.23861211
    2.10E-02 2.68E-02
    1.91E-02 0.23839023
    2.20E-02 2.69E-02
    2.00E-02 0.23816856
    2.30E-02 2.70E-02
    2.10E-02 0.23789175
    2.20E-02 0.23767054
    2.41E-02 2.72E-02
    2.30E-02 0.23739432
    2.52E-02 2.73E-02
    2.41E-02 0.23711841
    2.64E-02 2.74E-02
    2.52E-02 0.23678775
    2.77E-02 2.76E-02
    2.64E-02 0.23651255
    2.88E-02 2.77E-02
    2.90E-02 2.77E-02
    2.77E-02 0.23618274
    3.04E-02 2.78E-02
    2.90E-02 0.23585338
    3.18E-02 2.80E-02
    3.04E-02 0.23552448
    3.33E-02 2.81E-02
    3.18E-02 0.23514135
    3.49E-02 2.83E-02
    3.33E-02 0.23475884
    3.65E-02 2.84E-02
    3.49E-02 0.23437695
    3.83E-02 2.86E-02
    3.65E-02 0.23399568
    4.01E-02 2.87E-02
    3.83E-02 0.23356071
    4.20E-02 2.89E-02
    4.01E-02 0.23312655
    4.32E-02 2.90E-02
    4.17E-02 0.23272025
    4.40E-02 2.91E-02
    4.20E-02 0.23263907
    4.40E-02 0.23215262
    4.61E-02 2.92E-02
    4.61E-02 0.23166719
    4.82E-02 2.94E-02
    4.82E-02 0.231129
    5.05E-02 2.96E-02
    5.05E-02 0.23059207
    5.29E-02 2.98E-02
    5.29E-02 0.23005639
    5.54E-02 2.99E-02
    5.54E-02 0.22946857
    5.81E-02 3.01E-02
    5.81E-02 0.22882903
    6.08E-02 3.03E-02
    6.17E-02 3.04E-02
    6.08E-02 0.22819127
    6.37E-02 3.05E-02
    6.37E-02 0.22755529
    6.67E-02 3.07E-02
    6.67E-02 0.22686831
    6.99E-02 3.09E-02
    6.99E-02 0.22613081
    7.32E-02 3.11E-02
    7.32E-02 0.2253957
    7.66E-02 3.13E-02
    7.66E-02 0.22466299
    8.03E-02 3.15E-02
    8.03E-02 0.22388058
    8.41E-02 3.17E-02
    8.57E-02 3.18E-02
    8.41E-02 0.22304901
    8.80E-02 3.19E-02
    8.80E-02 0.22219469
    8.80E-02 0.22216885
    9.22E-02 3.22E-02
    9.22E-02 0.22129216
    9.66E-02 3.24E-02
    9.66E-02 0.22036768
    0.1011638 3.26E-02
    0.1011638 0.21944706
    0.10595602 3.28E-02
    0.10595602 0.21847946
    0.11097525 3.31E-02
    0.11097525 0.21746555
    0.11623225 3.33E-02
    0.11665202 3.33E-02
    0.11623225 0.21640601
    0.12173827 3.35E-02
    0.12173827 0.21530154
    0.12750512 3.38E-02
    0.12750512 0.21420272
    0.13354516 3.40E-02
    0.13354516 0.21305994
    0.13987131 3.43E-02
    0.13846334 0.21214518
    0.13987131 0.21187398
    0.14649714 3.45E-02
    0.14649714 0.21064562
    0.15343684 3.48E-02
    0.15343684 0.20942438
    0.15651854 3.49E-02
    0.16070528 3.50E-02
    0.16070528 0.2081134
    0.16831804 3.53E-02
    0.16831804 0.20681062
    0.17629141 3.56E-02
    0.17629141 0.20542042
    0.18464249 3.58E-02
    0.18464249 0.20403957
    0.19338918 3.61E-02
    0.19338918 0.20262087
    0.19372681 0.20255019
    0.20255019 3.64E-02
    0.20255019 0.20111846
    0.20772654 3.65E-02
    0.21214518 3.67E-02
    0.21214518 0.19962719
    0.22219469 3.70E-02
    0.22219469 0.1981009
    0.23272025 3.72E-02
    0.23272025 0.19654056
    0.24374442 3.75E-02
    0.24374442 0.19490183
    0.25529081 3.78E-02
    0.2545497 0.19338918
    0.25529081 0.19327676
    0.26738416 3.81E-02
    0.26738416 0.19162067
    0.27345314 3.83E-02
    0.28005039 3.84E-02
    0.28005039 0.1899346
    0.29331663 3.87E-02
    0.29331663 0.1881758
    0.3072113 3.90E-02
    0.3072113 0.18643329
    0.32176418 3.94E-02
    0.32165194 0.18464249
    0.32176418 0.18462102
    0.33700643 3.97E-02
    0.33700643 0.18282637
    0.35297073 4.00E-02
    0.35297073 0.18096497
    0.35772281 4.01E-02
    0.36969127 4.03E-02
    0.36969127 0.17912251
    0.38720388 4.06E-02
    0.38720388 0.17721637
    0.39599247 0.17629141
    0.40554607 4.10E-02
    0.40554607 0.17528973
    0.42475716 4.13E-02
    0.42475716 0.17338404
    0.44487828 4.17E-02
    0.44487828 0.17141931
    0.46568172 4.20E-02
    0.46595257 4.20E-02
    0.46595257 0.16947685
    0.47852769 0.16831804
    0.48802516 4.23E-02
    0.48802516 0.16747847
    0.51114335 4.27E-02
    0.51114335 0.16546517
    0.53535667 4.30E-02
    0.53535667 0.16347608
    0.56071699 4.34E-02
    0.56071699 0.16147333
    0.57051725 0.16070528
    0.58727866 4.38E-02
    0.58727866 0.15942095
    0.60397037 4.40E-02
    0.61509858 4.41E-02
    0.61509858 0.15739465
    0.64423635 4.45E-02
    0.64423635 0.15535798
    0.67295208 0.15343684
    0.67475441 4.49E-02
    0.67475441 0.15331199
    0.70671813 4.52E-02
    0.70671813 0.15129295
    0.740196 4.56E-02
    0.740196 0.14923107
    0.77525975 4.60E-02
    0.77525975 0.14719729
    0.78077872 4.61E-02
    0.78770981 0.14649714
    0.8119845 4.64E-02
    0.8119845 0.14515746
    0.85044893 4.68E-02
    0.85044893 0.1431126
    0.89073546 4.72E-02
    0.89073546 0.14109656
    0.91605206 0.13987131
    0.9329304 4.76E-02
    0.9329304 0.13907657
    0.97712415 4.80E-02
    0.97712415 0.13705361
    1.0070018 4.82E-02
    1.0234114 4.84E-02
    1.0234114 0.13506008
    1.0598683 0.13354516
    1.0718913 4.88E-02
    1.0718913 0.1330646
    1.1226678 4.92E-02
    1.1226678 0.13106811
    1.1758496 4.96E-02
    1.1758496 0.12910158
    1.2214241 0.12750512
    1.2315506 5.01E-02
    1.2315506 0.12716455
    1.2898903 5.05E-02
    1.2898903 0.12522745
    1.2963564 5.05E-02
    1.3509935 5.09E-02
    1.3509935 0.12329119
    1.4030301 0.12173827
    1.4149913 5.13E-02
    1.4149913 0.12138487
    1.4820207 5.18E-02
    1.4820207 0.11950802
    1.5522254 5.22E-02
    1.5522254 0.11763282
    1.6071463 0.11623225
    1.6257557 5.27E-02
    1.6257557 0.11578706
    1.6657529 5.29E-02
    1.7027692 5.31E-02
    1.7027692 0.11394374
    1.7834309 5.36E-02
    1.7834309 0.11212978
    1.8371082 0.11097525
    1.8679136 5.41E-02
    1.8679136 0.11034469
    1.9563983 5.45E-02
    1.9563983 0.10856277
    2.0490747 5.50E-02
    2.0490747 0.10680962
    2.0960712 0.10595602
    2.1379211 5.54E-02
    2.1461412 5.55E-02
    2.1461412 0.10508479
    2.2478058 5.59E-02
    2.2478058 0.10336377
    2.3542864 5.64E-02
    2.3542864 0.10167093
    2.3876477 0.1011638
    2.4658111 5.69E-02
    2.4658111 0.10000581
    2.5826188 5.74E-02
    2.5826188 9.84E-02
    2.7049597 5.79E-02
    2.7049597 9.67E-02
    2.7166234 9.66E-02
    2.7413768 5.81E-02
    2.8330961 5.84E-02
    2.8330961 9.51E-02
    2.9673024 5.89E-02
    2.9673024 9.35E-02
    3.0873339 9.22E-02
    3.1078662 5.94E-02
    3.1078662 9.20E-02
    3.2550886 5.99E-02
    3.2550886 9.05E-02
    3.4092851 6.05E-02
    3.4092851 8.89E-02
    3.5061842 8.80E-02
    3.5118971 6.08E-02
    3.570786 6.10E-02
    3.570786 8.75E-02
    3.7399373 6.15E-02
    3.7399373 8.60E-02
    3.9171015 6.21E-02
    3.9171015 8.45E-02
    3.9781562 8.41E-02
    4.1026581 6.26E-02
    4.1026581 8.31E-02
    4.2970047 6.31E-02
    4.2970047 8.17E-02
    4.4958498 6.37E-02
    4.5005577 6.37E-02
    4.5005577 8.03E-02
    4.5115618 8.03E-02
    4.7137531 6.43E-02
    4.7137531 7.90E-02
    4.9370479 6.48E-02
    4.9370479 7.76E-02
    5.114109 7.66E-02
    5.1709202 6.54E-02
    5.1709202 7.63E-02
    5.4158714 6.60E-02
    5.4158714 7.50E-02
    5.6724261 6.65E-02
    5.6724261 7.37E-02
    5.752807 6.67E-02
    5.7930867 7.32E-02
    5.941134 6.71E-02
    5.941134 7.25E-02
    6.2225708 6.77E-02
    6.2225708 7.12E-02
    6.5173396 6.83E-02
    6.5173396 7.00E-02
    6.5606832 6.99E-02
    6.7648344 6.88E-02
    6.768658 6.91E-02
    6.779398 6.99E-02

    Note data is LOG-LOG. I plugged this into your spreadsheet, but it didn't create the nice enclosed figure I was expecting.
    Snap6.jpg

  14. #14
    Registered User
    Join Date
    04-27-2011
    Location
    San Diego
    MS-Off Ver
    Excel 97
    Posts
    4

    Re: How to sort GPS coordinates within a range?

    I have a .csv file with a longitude and a latitude column. In addition there are other columns of descriptive data. The questions and answers above went above my head so I am asking for a solution to my problem. My sort is so that the sorted data will be what I would call regionalized. So every data point near NYC will be together in the list, for instance. Can this be done
    Last edited by jborchel; 11-15-2019 at 04:02 PM.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,979

    Re: How to sort GPS coordinates within a range?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to sort GPS coordinates within a range?

    You're welcome.

  17. #17
    Registered User
    Join Date
    04-27-2011
    Location
    San Diego
    MS-Off Ver
    Excel 97
    Posts
    4

    Re: How to sort GPS coordinates within a range?

    Here is attachment for previous post.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    06-24-2021
    Location
    Cape Town, South Africa
    MS-Off Ver
    O365
    Posts
    2

    Re: How to sort GPS coordinates within a range?

    Hi

    I have an issue with sorting the test data in the attached document - can you help?

    Pierre
    Attached Files Attached Files

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,979

    Re: How to sort GPS coordinates within a range?

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sort based on values/coordinates
    By dotdll in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-18-2015, 08:10 PM
  2. sort coordinates independently
    By darby1981 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2013, 03:37 PM
  3. [SOLVED] Getting screen coordinates from Range
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2006, 12:20 PM
  4. [SOLVED] extrapolate range coordinates
    By Cheer-Phil-ly in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2006, 05:50 PM
  5. [SOLVED] Convert point coordinates -> pixel coordinates
    By Zorro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2006, 10:30 PM
  6. And once again: X and Y Screen Coordinates of a Range
    By marsou in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-23-2005, 07:05 AM
  7. [SOLVED] [SOLVED] X and Y Screen Coordinates of a Range !!!
    By RAFAAJ2000 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-21-2005, 08:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1