wpietri / simpleais

A simple Python AIS parser intended for casual use.
GNU Lesser General Public License v3.0
15 stars 6 forks source link

Incorrect longitude/latitude scaling for message 27 #2

Closed prgbwt closed 8 months ago

prgbwt commented 2 years ago

First, thanks for your work on simpleais, it is quite useful.

I noticed that simpleais reports bad longitude/latitude values for message 27. The root cause appears to be that _parse_lon/_parse_lat use a scale factor of 4 (10^4) regardless of message type, which gives incorrect results for message 27. Message 27 longitude/latitude has a lower resolution (degrees/10) than other AIS message types (degrees/10000).

Excerpt from the standard: image

Cheers

wpietri commented 8 months ago

Thanks, this should be fixed in #5.