Modify

Opened 16 years ago

Closed 16 years ago

#1519 closed defect (fixed)

[PATCH] Fix NumberFormatException in NmeaReader

Reported by: egore@… Owned by: framm
Priority: major Milestone:
Component: Core Version:
Keywords: Cc:

Description

Right now the NmeaReader hardcodes a few values that will work if the device/program creating the NMEA file will follow the standard 100%. Naturally some programs don't do that. The attached patch works around that by starting from the rear end parsing latidute and longitude.

The format is xxDDLL.LLLL
xx optional whitespace
DD (int) degres
LL.LLLL (double) latidude

It also trims of any whitspace and skips points that don't follow this format. I'm not sure if silently skipping or bombing out is the better solution. If one the commiter thinks throwing an exception is better just remove the

if (latdegsep < 0) {

return null;

}

and

if (londegsep < 0) {

return null;

}

lines.

Attachments (1)

nmea-stabilization.patch (1.7 KB ) - added by anonymous 16 years ago.

Download all attachments as: .zip

Change History (2)

by anonymous, 16 years ago

Attachment: nmea-stabilization.patch added

comment:1 by anonymous, 16 years ago

Resolution: fixed
Status: newclosed

Added in r938.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain framm.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.