Expose DSID product specification subfields (PRSP, PSDN, PRED, PROF) - #18
Merged
Merged
Conversation
Add ProductSpecification, ProductSpecificationDescription, ProductSpecificationEdition and ApplicationProfile to S57DataSetIdentification and populate them in S57DocumentReader for both binary and ASCII lexical forms. Fix the ProducingAgency doc comment to cite AGEN instead of PRSP. Fixes #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17. This is needed for inland ENC support in philliphoff/EncDotNet.S100#608.
Changes
S57DataSetIdentification: four new properties, added after the existing ones:ProductSpecification(PRSP,int). The docs note that S-57 §7.3.1.1 enumerates 1 = ENC and 2 = ODD, and that inland ENC producers declare 10.ProductSpecificationDescription(PSDN,string)ProductSpecificationEdition(PRED,string)ApplicationProfile(PROF,int)S57DocumentReader: populates the new properties with the sameTryGetSubfieldpattern used for AGEN / COMT, defaulting to 0 / empty when a subfield is absent.ENC/ODD, A(2)EN/ER/DD).byte, as INTU is read, would throw on an ASCII cell.10are parsed directly, and unknown values become 0.ProducingAgencynow says (AGEN) instead of (PRSP).Tests
New tests in
S57DocumentReaderTestsuse synthetic data only:ENC/ODD/EN/ER/DDand a numeric10map to the right codes.I ran the tests with
dotnet test tests/EndDotNet.UnitTestsin the repo on macOS. The NU1605 restore error did not occur, so the scratch project was not needed. All 492 tests pass.Both format gates are clean:
dotnet format whitespace EncDotNet.slnx --verify-no-changesdotnet format style EncDotNet.slnx --diagnostics IDE0005 --severity warn --verify-no-changes