Add the following utility methods to ubxhelpers.py:
latlon2dms - converts decimal lat/lon to degrees, minutes, decimal seconds format e.g. "53°20′45.6″N", "2°32′46.68″W"
latlon2dmm - converts decimal lat/lon to degrees, decimal minutes format e.g. "53°20.76′N", "2°32.778′W"
ecef2llh - converts ECEF (X, Y, Z) coordinates to geodetic (lat, lon, height) coordinates
llh2ecef - converts geodetic (lat, lon, helght) coordinates to ECEF (X, Y, Z) coordinates
haversine - finds spherical distance in km between two sets of (lat, lon) coordinates
Testing
Please test all changes, however trivial, against the supplied unittest suite tests/test_*.py e.g. by executing the tests/testsuite.py module or using your IDE's native Python unittest integration facilities. Please describe any test cases you have amended or added to this suite to maintain >= 99% code coverage.
If you're adding new UBX message definitions for Generation 9+ devices, please check for any corresponding configuration database updates (ubxtypes_configdb.py).
[x] 5 new tests added to test_static.py
Checklist:
[x] My code follows the style guidelines of this project (see CONTRIBUTING.MD).
[x] I have performed a self-review of my own code.
[x] (if appropriate) I have cited my u-blox documentation source(s).
[x] I have commented my code, particularly in hard-to-understand areas.
[x] I have made corresponding changes to the documentation.
[x] (if appropriate) I have added test cases to the tests/test_*.py unittest suite to maintain >= 99% code coverage.
[x] I have tested my code against the full tests/test_*.py unittest suite.
[x] My changes generate no new warnings.
[x] Any dependent changes have been merged and published in downstream modules.
[x] I understand and acknowledge that the code will be published under a BSD 3-Clause license.
pyubx2 Pull Request Template
Description
Add the following utility methods to
ubxhelpers.py
:latlon2dms
- converts decimal lat/lon to degrees, minutes, decimal seconds format e.g. "53°20′45.6″N", "2°32′46.68″W"latlon2dmm
- converts decimal lat/lon to degrees, decimal minutes format e.g. "53°20.76′N", "2°32.778′W"ecef2llh
- converts ECEF (X, Y, Z) coordinates to geodetic (lat, lon, height) coordinatesllh2ecef
- converts geodetic (lat, lon, helght) coordinates to ECEF (X, Y, Z) coordinateshaversine
- finds spherical distance in km between two sets of (lat, lon) coordinatesTesting
Please test all changes, however trivial, against the supplied unittest suite
tests/test_*.py
e.g. by executing thetests/testsuite.py
module or using your IDE's native Python unittest integration facilities. Please describe any test cases you have amended or added to this suite to maintain >= 99% code coverage.If you're adding new UBX message definitions for Generation 9+ devices, please check for any corresponding configuration database updates (
ubxtypes_configdb.py
).test_static.py
Checklist:
CONTRIBUTING.MD
).tests/test_*.py
unittest suite to maintain >= 99% code coverage.tests/test_*.py
unittest suite.