Why we need to convert GPS coordinates(latitude, longitude) from degrees and minutes into decimal degrees

1.4k views Asked by At

I'm getting NMEA data from the GPS. This one I'm converting into decimal degrees for using them in Google maps.

We have GPS coordinates conversions like degrees to minutes and seconds.

Why do we need to convert the coordinates between this two representations? Where will we use this conversion(degrees to seconds), and how is this coded.

2

There are 2 answers

0
Nodak On BEST ANSWER

Sexagesimal (base 60) is a numeral system with sixty as its base. It originated with the ancient Sumerians in the 3rd millennium BC, it was passed down to the ancient Babylonians, and it is still used—in a modified form—for measuring time, angles, and geographic coordinates.

Degree minutes and degree seconds are not units of time, but a reference to the degree in the sexagesimal system.

For further information: https://en.wikipedia.org/wiki/Sexagesimal

0
AlexWien On

NMEA provides the cooridnates in a special variant of the DMS Systems. (DMS = Degrees, Minutes, second which is another possibility to specify a coordinate)

This variant is called DM format:
(integral) degrees, and decimal minutes (no extra field for seconds).

For google maps you need decimal degrees (DEG), and you have DM. So you need a DM to DEG conversion:

DEG = Degrees + Minutes / 60.0

example:

 double latitudeDecimalDegrees = degrees + minutes / 60.0;
 if ("S".equals(nortSouth) && degrees > 0) {
     lat *= -1.0;
 }

where northSouth is either "N" or "S" for latitude, provided in the NMEA message as NS Indikator.