GPS programming in practice

Discussion in 'Questions (Windows Mobile)' started by Put Claude, Oct 18, 2007.

  1. Put Claude

    Put Claude Active Member Licensed User


    Like mentioned before, I will inform the forum of the results I achived on their instructions and help.
    Out of 1407 waypoint, I had to check every second the aproch to one of them, so I will be warned.
    So, I used binaire search to make a array-gap from 8 points (on advise of the forum, This takes max. 200 mSec for 1400 points), then I had only 8 waypoints to check. When my position is out of range of my 8 waypoints, I create a new array-gap arround my position (this wil only happen from time to time).
    This works enormesly robust by the binair search, with only very little overhead to secure things. That all.
    Some times here:
    Fetch from GPS of a GPRMC sentens: 40 mSec.
    Valid fetch and all the work that has be done: max. 200 mSec.
    With array-gap and the whole bunch: max. 400 mSec.
    This all while I do plot the whole route, with all data possible...
    So, there is time to do some Map displacement I think ;-)

    I have to remark that I use only easy things from B4PPC, like tables, labels and buttons, non sofisticated things or trics (beginners mode)...
    Have to mention also, that the behavior tables do surprise me, the SORT do change only indexes, and the SAVE csv do not always work, I had to save under a different name as it was loaded...
    Can we use a variable to a string to use as a Filename?
    Has the forum some idee what I have to do if I want go up to 14000 waypoint to search on?

    Put Claude Belgium
    Last edited: Oct 18, 2007
  2. Erel

    Erel Administrator Staff Member Licensed User

    About the filename, yes you can use variables in the file name.
    Sort (and Filter) function doesn't change the database. It only changes the data appearance.
  3. Put Claude

    Put Claude Active Member Licensed User


    Thanks Erel, I am pleased to get a confirmation...

    Put claude Belgium
  4. agraham

    agraham Expert Licensed User

    As long as you only want to search and then operate on a single found (or not!) waypoint then I would think you should have no trouble as long as you stick to a binary search. You shouldn't even need to change any of your code - just give it the extra data.

    At the moment you have about 12 or 13 comparisons to make to search your entire set of 1407 waypoints. To search over 14000 would only add another four comparisons making 16 or 17 total so the increase in time is small.
  5. Put Claude

    Put Claude Active Member Licensed User

    hi agraham,

    You are right, just did not think about that... Thanks to remember me of that...

    Put Claude Belgium
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice