Skip to content

longitude & latitude stored as strings? #9

@ajmas

Description

@ajmas

Is there any reason why longitude & latitude are stored as strings, rather than as floats?

Using the following code, with the current latest

var sentences = [
   '$GPRMC,,V,,,,,,,,,,N*53',
   '$GPGGA,,,,,,0,00,99.99,,,,,,*48',
   '$GPGGA,182213.00,4531.14046,N,07334.85370,W,1,10,0.86,54.7,M,-32.6,M,,*58'
]

for (i=0; i<sentences.length; i++) {
    console.log(nmea.parse(sentences[i]));
}

I get the following results:

{ id: 'GPGGA',
  time: '',
  latitude: 'NaN',
  longitude: 'NaN',
  fix: 0,
  satellites: 0,
  hdop: 99.99,
  altitude: NaN,
  aboveGeoid: NaN,
  dgpsUpdate: '',
  dgpsReference: '' }
{ id: 'GPGGA',
  time: '182213.00',
  latitude: '45.51900767',
  longitude: '-73.58089500',
  fix: 1,
  satellites: 10,
  hdop: 0.86,
  altitude: 54.7,
  aboveGeoid: -32.6,
  dgpsUpdate: '',
  dgpsReference: '' }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions