Mobile GMaps Home Page
 FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups   RegisterRegister  
 ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in 

GPS number format

 
Post new topic   Reply to topic   printer-friendly view    MGMaps Forum Index -> Developer Forum
View previous topic :: View next topic  
Author Message
kolaf
Developer


Joined: 22 Jul 2006
Posts: 23

Phone Type: Unknown

PostPosted: Fri Aug 25, 2006 12:39 pm    Post subject: GPS number format Reply with quote

Hi,

I thought I might as well start posting here for future reference.

I am wondering about the number format to use for GPS data. Am I correct in assuming that each floatingpoint number received from the GPS receiver such as speed and altitude are represented as long numbers where the three least significant numbers are the decimals? And also, the speed is stored as m/h?

in other words, to get km/h I would have to divide the speed by 1000000, correct?

Will also have to add a few more fields to the GPS system as I use textual representations of latitude and longitude, and it makes no sense of converting things to integers and then back again Smile
Back to top
View user's profile Send private message Visit poster's website
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Fri Aug 25, 2006 1:12 pm    Post subject: Reply with quote

Hi,

Things were designed to work in CLDC 1.0 / MIDP 1.0, where there's no support for floating point, all numbers are stored as integers and are used this way:

  • lat/lon, 6 decimals: actual value * 1000000
  • speed, 3 decimals: value in km/h * 1000 (so m/h)
  • altitude, 3 decimals: value in m * 1000 (so mm)

Cristian
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MGMaps Forum Index -> Developer Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
MGMaps topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group