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

LAD / LOD extensions for B records #521

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

spasutto
Copy link

example :

    I013637LAD
    B1526594446200N00547906EA013770137247

source : https://www.fai.org/sites/default/files/igc_fr_specification_with_al8_2023-2-1_0.pdf

Lat/Long - D D M M m m m N D D D M M m m m E
DD - Latitude degrees with leading 0 where necessary
DDD - Longitude degrees with leading 0 or 00 where necessary
MMmmmNSEW - Lat/Long minutes with leading 0 where necessary, 3 decimal places of minutes are mandatory,
followed by N, S, E or W as appropriate. If additional digits are used, for the fractional minutes define the positions
through codes LAD and LOF in the I record.

@Turbo87
Copy link
Owner

Turbo87 commented Feb 19, 2023

can you add a few tests to make sure it works as expected and will not regress in the future? 🙏

example :
  I013637LAD
  B1526594446200N00547906EA013770137247
@spasutto
Copy link
Author

Hello, I slightly modified the commit code (no more impact on parseLatitude function) and added IGC Sample/associated tests.
Let me now if the code/tests needs revisions 👍

@spasutto
Copy link
Author

Note 1 : the code directly regex test the extension :
RE_INT.test(extensions['LAD'])
Even if there isn't 'LAD' extension.
I've tested this snippet without the extension it return false so I assume there's no need to test on presence in extensions but I can strengthen if you want !

Note 2 : the extension parsing block was simply moved (without modification) above the lat/lon parsing (where LAD/LOD extensions are needed).

Copy link
Owner

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@spasutto
Copy link
Author

spasutto commented Mar 4, 2023

Sorry I'm not familiar with Jest, I've added the test in the snapshot file, I hope that will solve the workflow problem

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

Successfully merging this pull request may close these issues.

2 participants