Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7979033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:39:30+00:00 2026-06-04T09:39:30+00:00

I have a GPS device which sends data to my server, I need to

  • 0

I have a GPS device which sends data to my server, I need to convert the decimal values that the device sends into latitude and longitude. I am bad at math so all my attempts failed, here are the specs:

Latitude

Occupy 4 bytes, representing the latitude value.

Number range is from 0 to 162000000, which represents the range form 0°to 90°.
Unit: 1/500 second Conversion method:

A) Convert the latitude (degrees, minutes) data from GPS module into a new form which represents the value only in minutes;

B Multiply the converted value by 30000, and then transform the result to hexadecimal number

For example22°32.7658′,(22×60+32.7658)×30000=40582974, then convert it to hexadecimal number 0x02 0x6B 0x3F 0x3E

Longitude

Occupy 4 bytes, representing the longitude value of location data. Number ranges from 0 to 324000000, representing the range form 0°to 180°.Unit: 1/500 seconds, Conversion method is the same as latitude’s.

I came up with this function but it doesn’t seem to work:

procedure GetDegree(const numar : DWORD; out min,sec : Extended);
var
  eu : Extended;
begin
  eu :=  numar / 30000;
  min := Trunc(eu / 60);
  sec := eu - min * 60;
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:39:33+00:00Added an answer on June 4, 2026 at 9:39 am

    numar is specified in 1/500th of a second. So, the following equations hold:

    num/500 = seconds
    num/500/60 = minutes
    num/500/60/60 = degrees
    

    I would calculate it all like this:

    var
      degrees, minutes, seconds: Integer;
    ....
      degrees := num div (500*60*60);
      minutes := num div (500*60) - degrees*60;
      seconds := num div 500 - minutes*60 - degrees*60*60;
    

    If you need to calculate the fractional part of seconds then do it like this. Note that there’s simply no need for Extended here.

    var
      degrees, minutes: Integer;
      seconds: Double;
    ....
      degrees := num div (500*60*60);
      minutes := num div (500*60) - degrees*60;
      seconds := num/500 - minutes*60 - degrees*60*60;
    

    Plug your value of 40582974 into these formula and the results are:

    degrees: 22
    minutes: 32
    seconds: 45
    

    Judging from comments what you actually want is degrees as an integer and minutes as a floating point. That you can do like this:

    var
      degrees: Integer;
      minutes: Double;
    ....
      degrees := num div (500*60*60);
      minutes := num/(500*60) - degrees*60;
    

    Plug your value of 40582974 into these formula and the results are:

    degrees: 22
    minutes: 32.7658
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which receives GPS data from a mobile device as well
I have a GPS device for which I need to get: - the last
I have an app that revolves around the device's GPS and the information that
have an app that finds your GPS location successfully, but I need to be
I have a thread that sends GPS coordinates to a database every six seconds
I have here a device which can give me GPS coordinates. The time interval
i have a GPS device that will be installed in many trucks. i can
The application that I have in the works uses GPS data to mark files
I have the following problem: I have a Wintec WBT-202 GPS device which has
I have a Mio P550 device, which has a GPS included. I try to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.