Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latitude/longitude degrees are parsed incorrectly #10

Open
chemicstry opened this issue Nov 14, 2020 · 3 comments
Open

Latitude/longitude degrees are parsed incorrectly #10

chemicstry opened this issue Nov 14, 2020 · 3 comments

Comments

@chemicstry
Copy link

Library parses latitude/longitude degrees by just dividing float value by 100.0 https://github.com/66Origin/nmea-0183/blob/master/src/fields/distance/parsers.rs#L26 but this is incorrect.

For example value 4717.11399 actually means 47 degrees and 17.11399 minutes. To convert this into degrees you have to calculate it as follows: 47 + 17.11399 / 60 which equals to ~47.2852332. You can test this on any NMEA parser and see that current library test cases are incorrect.

I fixed parsing in my fork and also removed N/S, E/W indicators by returning negative degrees when appropriate. Let me know if you want me to submit a PR like this. chemicstry@d980978

@o0Ignition0o
Copy link
Contributor

Hey there!

Super glad you had a chance to improve on that 🎉

It makes total sense, I kind of overlooked it back then.

In the meantime Aerorust was born, and we decided to work on https://github.com/AeroRust/nmea all together.

I don’t know what would make most sense to you, but feel free to submit a PR, or try out the other repo, or join aerorust’s discord, it all depends on you :D

@OtaK
Copy link

OtaK commented Nov 15, 2020

I think it'd make sense in that context to mention AeroRust/nmea in the README and archive this repo?

@o0Ignition0o
Copy link
Contributor

Good idea, I'll try to do that next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants