+ Reply to Thread
Results 1 to 5 of 5

Sort list of GPS waypoints by both Lat and Long, not by Lat then Long.

  1. #1
    Registered User
    Join Date
    09-22-2012
    Location
    GA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Sort list of GPS waypoints by both Lat and Long, not by Lat then Long.

    First I'd like to introduce myself, my name is Jim and I'm an avid fisherman.

    I want to sort GPS waypoints based on both Latitude and longitude and can not figure out how to make this work. Any help would be greatly appreciated.

    Image 4 lakes arranged like this geographically (below). Lakes 1 and 2 occupy the same Lats N to S, Lakes 3 and 4 occupy the same Lats N to S, lakes 1 and 3 occupy the same Longs E to W, and lakes 2 and 4 occupy the same Longs E to W.Also, imagine that each lake had 3 waypoints in the exact center E to W and 1 at the Norther most point, 1 in the middle N to S,and 1 at the Southern most point of the lake.

    Lake1 Lake2
    Lake3 Lake4

    I want my sort to end up like this.
    Lake4 waypoints
    Lake3 waypoints
    Lake2 waypoints
    Lake1 waypoints

    This is some test data, I really do not have the lake name or consistent waypoint naming to start with (thought it would be helpful for testing) I can only rely on having to sorting by lat and long.

    Lat Long Lake waypoint name
    28 00 00.0 80 00 00.0 Lake 1 1
    27 00 00.0 80 00 00.0 Lake 1 2
    26 00 00.0 80 00 00.0 Lake 1 3
    28 00 00.0 78 00 00.0 Lake 2 4
    27 00 00.0 78 00 00.0 Lake 2 5
    26 00 00.0 78 00 00.0 Lake 2 6
    25 00 00.0 80 00 00.0 Lake 3 7
    24 00 00.0 80 00 00.0 Lake 3 8
    23 00 00.0 80 00 00.0 Lake 3 9
    25 00 00.0 78 00 00.0 Lake 4 10
    24 00 00.0 78 00 00.0 Lake 4 11
    23 00 00.0 78 00 00.0 Lake 4 12

  2. #2
    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: Sort list of GPS waypoints by both Lat and Long, not by Lat then Long.

    I don't think you can do better than to annotate each point and sort by that:

    Lake Bob Wpt 1
    Lake Bob Wpt 2
    Lake Bob Wpt 3

    Lake Joe Wpt 1
    Lake Joe Wpt 2
    Lake Joe Wpt 3
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-22-2012
    Location
    GA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Sort list of GPS waypoints by both Lat and Long, not by Lat then Long.

    That is what I do now, and it is laborious. I was hoping someone had a formula for x,y comparing that produced the desired grouping.

    Thanks,
    Jim

  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: Sort list of GPS waypoints by both Lat and Long, not by Lat then Long.

    There are lots of algorithms for connecting random points (Google delaunay triangulation, for example); none are trivial, and I'm not sure what the value of the end result would be.

    You could subivide the points into, say, a 3 x 3 grid (Top-Left, Top-Center, Top-Right ...), and sort by grid coordinate, but I don't see how that would help keep relevant data together.

    EDIT: Plotting the points would give a visual aid to the annotation.
    Last edited by shg; 09-22-2012 at 02:44 PM.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Sort list of GPS waypoints by both Lat and Long, not by Lat then Long.

    I'm not sure how one would implement this in Excel (as shg says, I doubt it is a trivial algorithm to put in), but the way I use to do this with a free GPS waypoint program called EasyGPS went something like this:

    Select a reference waypoint.
    Calculate bearing and distance for each waypoint from the reference waypoint (the program I had did these calculations automatically. I'm sure Excel could be programmed to calculate these values, and I'm pretty sure the algorithms have been discussed here before).)
    Then you can "sort" your waypoints based on bearing and distance from the reference waypoint. If your reference waypoint is reasonably well selected, then the points associated with each lake should cluster together.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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