Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latitude Longitude in wrong format DDDMM.MMMM 2832.3396N

I have a gps module that gives me latitude in longitude in a weird format.

DDDMM.MMMM

As written on user manual, Degrees*100 + Minutes.

As far as I know, It is degrees minutes seconds, and seconds is between 0-59, above than this will increment the minute. But this is giving minutes in decimal places. Does this means 1/1000th of a minute?

eg. 07717.3644 E
077 --> degrees
17 --> minutes
3644 --> ?
E --> Direction

Also how will I convert it to decimal, I am using the formula

decimal = degrees + minutes/60 + seconds/3600.
like image 721
Ishmeet Avatar asked Aug 26 '13 10:08

Ishmeet


People also ask

How do you convert Ddmm mmmm to decimal degrees?

To convert this to the decimal format, we start by keeping the DD portion and simply divide the MM. MMM by 60 to firm the MMM portion of the decimal format.

How do you format latitude and longitude?

Here are examples of formats that work: Decimal degrees (DD): 41.40338, 2.17403. Degrees, minutes, and seconds (DMS): 41°24'12.2"N 2°10'26.5"E. Degrees and decimal minutes (DMM): 41 24.2028, 2 10.4418.

What are the different formats of GPS coordinates?

Introduction. Terrain Navigator Pro allows you to display and enter Latitude/Longitude coordinates in three formats: Degrees Minutes Seconds (D° M' S"), Decimal Minutes (D° M. M'), and Decimal Degrees (D.D°). Each of these formats can represent the same geographic location, but expressed differently.


2 Answers

To convert this to the decimal format, we start by keeping the DD portion and simply divide the MM.MMM by 60 to firm the MMM portion of the decimal format.

43. (48.225/60), -79.(59.074/60)  

43.(0.80375), -79.(0.98456)  

43.80375, -79.98456    

In your case

eg. 07717.3644 E is the DDDMM.MMMM format

077 --> degrees
17 --> minutes
.3644 --> minutes equals to sec/60


decimal = degrees + minutes/60 

decimal = 77 + (17.3644 / 60)  

decimal = 77.28941

See this Link Would help you

like image 105
Gangadhar Avatar answered Sep 21 '22 07:09

Gangadhar


Follow the algorithm to convert the same.

var t = "7523.7983" // (DDMM.MMMM)
var g = "03412.9873" //(DDDMM.MMMM)

function lat(t){
  return (Number(t.slice(0,2)) + (Number(t.slice(2,9))/60))
}

function lng(g) {
  return (Number(g.slice(0,3)) + (Number(g.slice(3,10))/60))
}

console.log(lat(t)) 
console.log(lng(g))  
like image 5
KARTHIKEYAN.A Avatar answered Sep 23 '22 07:09

KARTHIKEYAN.A