inmcm / micropyGPS

A Full Featured GPS NMEA-0183 sentence parser for use with Micropython and the PyBoard embedded platform
MIT License
346 stars 119 forks source link

Produces decimal degrees that are incorrectly formatted. #27

Open Jollyjohn opened 5 years ago

Jollyjohn commented 5 years ago

The code produces decimal degrees that are incorrectly formatted.

This can be seen in the init function definition:

        Setup GPS Object Status Flags, Internal Data Registers, etc
            local_offset (int): Timzone Difference to UTC
            location_formatting (str): Style For Presenting Longitude/Latitude:
                                       Decimal Degree Minute (ddm) - 40° 26.767′ N
                                       Degrees Minutes Seconds (dms) - 40° 26′ 46″ N
                                       Decimal Degrees (dd) - 40.446° N

The correct format for "dd" is +/-90° for latitude, and +/-180° for longitude, with no compass heading suffix. The compass heading is encoded into the sign of the number. (See here) So in the example from the code would resolve to +40.446 not 40.446 N. In the southern hemisphere, it would resolve to -40.446, not 40.446 S.