Skip to content

Commit 0177d12

Browse files
committed
Add support for GPRMC with latitude and longitude in decimal degree
- Special case for BATOS instrument which has non standard sentence. - Use variable names: latitude_dd and longitude_dd to use this feature.
1 parent 5d9235a commit 0177d12

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

inlinino/instruments/nmea.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ def parse(self, packet):
8484
# RMC, overwrite latitude and longitude as computed incorrectly by pyNMEA or missing
8585
if msg.sentence_type == 'RMC':
8686
for i, k in enumerate(self.variable_names):
87-
if k == 'latitude' and hasattr(msg, 'lat') and hasattr(msg, 'lat_dir'):
87+
if k == 'latitude_dd' and hasattr(msg, 'lat') and hasattr(msg, 'lat_dir'):
8888
data[i] = float(msg.lat) * (1 if msg.lat_dir == 'N' else -1)
89-
elif k == 'longitude' and hasattr(msg, 'lon') and hasattr(msg, 'lon_dir'):
89+
elif k == 'longitude_dd' and hasattr(msg, 'lon') and hasattr(msg, 'lon_dir'):
9090
data[i] = float(msg.lon) * (1 if msg.lon_dir == 'E' else -1)
9191
return data
9292

0 commit comments

Comments
 (0)