Menu

#127 Waypoint sort order doesn't stay "Name Ascending"

v1.6
closed
nobody
None
5
2015-12-22
2015-11-14
dav
No

I've found an annoying behaviour ot Viking 1.6 -- every time I start work on a file and expand the waypoint list of a layer, the waypoints are not sorted by name.

Even with sort "Name Ascending" set in the layer WP properties.

Steps to reproduce:
Open file
expand layer wp list
-> wp names are not in order of name
---expected: wp names follow fhe rule set in Properties

A few quirks..
I opened a wp list and its unordered - then I open the layer properties (already set to name ascending) click OK and then the list becomes ordered.

Or, while unordered, I paste a wp to the list --> list becomes ordered.

I have checked the file with regexxer, to replace all wpsortorder=0 with wpsortorder=1

But I open the file and have the same result - even though properties reports "Name Ascending"

It's possible its with just one file I have, which is >9Mb in size. Other files seem to keep the order setting for next time.

What would be nice is "Name Ascending" as default - as then one wouldn't need to set that for every layer of every new project.

Thanks

Discussion

  • Rob Norris

    Rob Norris - 2015-11-14

    Unfortunately I can't reproduce this on my systems.

    I'm not sure why it could be happening for you, neither can I think of anything to try ATM.

    How many Waypoints do you have in a single layer? (The most I have in a test setup is ~1000).

    What would be nice is "Name Ascending" as default - as then one wouldn't need to set that for every layer of every new project.

    You can do this already via the Layer Defaults:

    Go to Edit->Layer Preferences->TrackWaypoint... and then set the Waypoint Sort Order to whatever value you want (the default is 'unsorted').

    Note this only applies to new layers created within Viking (as opposed to loading from GPX files for example).

     
  • lbayuk

    lbayuk - 2015-12-05

    New user with viking-1.6.1, and I am seeing the exact same issue. My waypoint sorting order is not being retained. As dav says, just opening Properties and OK sorts them, but it doesn't save across restarts.

    I can reproduce this with a very small data set: just 12 waypoints, no tracks, no map. After playing around with it, it seems to me that waypoint sorting is being retained for TrackWaypoint layers under the top layer, but not for TrackWaypoint layers under an Aggregate layer. Is that possible?

    But - perhaps depending on how I import the GPX file - the waypoints might already be sorted by name in the Viking file, in which case they appear to be sorted (even if Viking isn't preserving the order). In that case, I pick Sort by Name Descending, to be able to see the problem.

    Hope this helps.

     
  • Rob Norris

    Rob Norris - 2015-12-06

    @lbayuk thanks for the extra info, which gave me more impetus to look at this again and now I can reproduce this issue and understand it.

    ATM Sorting waypoints relies on the GUI system being ready and initialized - the left treeview being 'realized'.
    Thus if one loads a file via the command line i.e.

    viking MyFileWithWaypoints.vik
    

    then the waypoints can be loaded before the GUI is initialized fully and so defaults to being in the literal order saved within the .vik file (i.e. no particular sort order - or even possibly in time creation order).

    On any subsequent relevant action via the GUI the sorting can then be performed since the GUI is completely ready.

    Hence when loading files from within the GUI (File->Open etc...), the GUI is ready and so the sorting gets applied (as in my original testing and my general usage pattern).

    I'll need to think through the best fix for this, but hopefully the workaround of opening files within the GUI should suffice for now.

    HTH.

     
  • lbayuk

    lbayuk - 2015-12-06

    Well, that is odd because I repeated my tests and that is not what I am seeing.

    I created a file that looks like this:

    • Top layer
      • Aggregate
        • TrackWaypoint1
          • Waypoints
      • TrackWaypoint2
        • Waypoints

    Under each of the TrackWaypoint layers, I made 3 trackpoints called Z, X, and Y in that order (manually created within Viking). I set the Waypoint Sort order for both TrackWaypoint layers to sort waypoints by Name Ascending.

    Regardless of whether I start Viking from the command line with the test file as the argument, or start Viking someother way and then load the test file in, what I see is: The waypoints are correctly sorted X Y Z under TrackWaypoint2 (the one directly under Top), but are unsorted as Z X Y under Trackwaypoint1 (the one under the aggregate).

    I must be doing something wrong, or there is another factor at work here, for us to be seeing such disparate results.

    Would it help if I posted my little test file?

     
  • Rob Norris

    Rob Norris - 2015-12-07

    @lbayuk Thanks for the detailed report.

    Would it help if I posted my little test file?

    Don't worry, it is from the same root cause.

     

    Last edit: Rob Norris 2015-12-07
  • Rob Norris

    Rob Norris - 2015-12-07

    The fix has been committed into the source code repository.

     
  • Rob Norris

    Rob Norris - 2015-12-07
    • status: open --> pending
     
  • Rob Norris

    Rob Norris - 2015-12-22
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB