×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    22

    Question Problem in getting speed and direction in gps

    I have started a project using gps and the coding is in j2me.I can locate the device in a map by getting latitude and longitude values. Time is also accessible.But when am trying to access the speed and direction the value getting is NaN.The code I have used is location.getSpeed(); and location.getCourse(); Where location is an object of type Location....So What I have to get the exact values of speed and direction...

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,561

    Re: Problem in getting speed and direction in gps

    Maybe a stupid question, but are you actually moving when you run your app and try to get the speed and direction?

  3. #3
    Super Contributor
    Join Date
    Jul 2007
    Location
    Magnitogorsk, Russia
    Posts
    536

    Re: Problem in getting speed and direction in gps

    Hi,

    I also have problems with getting current direction of movement - the result is always NaN. So I wrote own algorithm:

    http://wiki.forum.nokia.com/index.ph...on_of_movement

  4. #4
    Registered User
    Join Date
    May 2008
    Posts
    22

    Re: Problem in getting speed and direction in gps

    Actually all other values are getting correct...when am moving, latitude and longitude values are getting updated and I can map it correctly but only problem is with speed and direction...Only these two methods ie location.getSpeed(); and location.getCourse(); return NaN. This much portion is become a trouble for me...Need help from you.

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    22

    Re: Problem in getting speed and direction in gps

    Hi,
    Thanks For ur reply..But would you please tell me whats actually,TReals type is it a long value or in degree minute second or some other format...I don't know much more about that calculation....

  6. #6
    Super Contributor
    Join Date
    Jul 2007
    Location
    Magnitogorsk, Russia
    Posts
    536

    Re: Problem in getting speed and direction in gps

    You should use long values for calculations. When you receive values of latitude and longitude - they presented in decimal system and it is good for calculation. But if you want to show latitude/longitude in dialogs you should translate them into deg, minutes and seconds.

    This article contains small example:
    http://wiki.forum.nokia.com/index.ph...how_a_landmark

  7. #7
    Registered User
    Join Date
    May 2008
    Posts
    22

    Re: Problem in getting speed and direction in gps

    Hi, Thanks for ur help...
    I have made little changes to my code and now am getting the speed and directions from the device using location.getSpeed(); and location.getCourse(); methods. Below the changes that i made....
    * cr.setSpeedAndCourseRequired(true); where cr is an instance of Criteria.
    Before this I hadn't even set this. at that time its take its default value as false.that means doesn't required speed and course.

    Anyway thanks for your valuable sugestion.

  8. #8
    Registered User
    Join Date
    Feb 2009
    Posts
    7

    Re: Problem in getting speed and direction in gps

    Thanks Darwin, very good information ! I was thinking my 6110 navigator doesn't provide this speed information, and it was a criteria default setting... I'll test it soon in my app.
    Yann


    Quote Originally Posted by darwin_cyriac View Post
    Hi, Thanks for ur help...
    I have made little changes to my code and now am getting the speed and directions from the device using location.getSpeed(); and location.getCourse(); methods. Below the changes that i made....
    * cr.setSpeedAndCourseRequired(true); where cr is an instance of Criteria.
    Before this I hadn't even set this. at that time its take its default value as false.that means doesn't required speed and course.

    Anyway thanks for your valuable sugestion.

  9. #9
    Registered User
    Join Date
    Mar 2009
    Posts
    1

    Re: Problem in getting speed and direction in gps

    I'm shopping for a GPS phone. Forget maps, speed, and voice directions. I want the equivalent of a low cost Garmin hand held device. I want to walk out into the middle of nowhere, establish a waypoint, walk to point "b" and know the direction and distance. All without subscribing to the provider's service (AT&T)

  10. #10
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Problem in getting speed and direction in gps

    Hi leom32w,
    Welcome to the Forum Nokia Developer Discussion boards. This forum concentrates on development related issues. You can try to post your query at Nokia Support Discussions board - http://discussions.europe.nokia.com/

Similar Threads

  1. Replies: 4
    Last Post: 2008-07-02, 18:52

Posting Permissions

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