for example, i have this GPS Location: DECIMAL 39.48235 -0.38792
and i need to transform it to DDD MM.MMM N 39° 28.941 W 000° 23.275
How to do it? I need to know necause i need to transform another GPS locations from DECIMAL to DDD MM.MMM
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
There is a pretty straight forward guide to it on wikipedia.
But the base of the calculation is like this:
Decimal input: 39.48235
Degress: 39 (whole number of the decimal)
Minutes: 28 = 28.941 = 0.48235 * 60 (fraction from the decimal multiplied by 60, and only accept the whole number)
Seconds: 56 = 56.46 = 0.941 * 60 (fraction from minutes multiplied by 60, and rounded)
Depending on the sign of the number and if it is lat or long will produce wheter it is’s NSEW that should be pre/postfixed.
(Assuming you are using Java since your name is prefixed android you could have a look at the following code if needed)