Closed jmMeessen closed 11 months ago
@w1mt , @thomasrussellmurphy : FYI
I used the list of POTA prefixes provided by @yu3fms to add an automated test of the validation routine. To my surprise, the test didn't fail as expected (maybe because you shouldn't code when tired).
I will review this again at the end of the day/WE.
I believe that the park list in the sample is incomplete. Just because a country doesn't have any parks in the POTA system now does not mean it won't in the future...
Good point @w1mt . So if I understand it well (I am not a POTA participant (yet)), the prefix has the structure of (part) of a call-sign. Could you help me get such unlisted prefix? I will experiment with the regexp and the list. I can also try to approach the POTA organizers for prefix rules and/or and exhaustive list of prefix (as they are validating the reference when parsing the submission). I can also contact the people active in POTA here in Belgium.
On the other side, I could relax the validation rules: (need the maximum length of a prefix though) But there also there are pros & cons. I need to clearly differentiate (with a regexp) a SOTA, a WWFF, and a POTA reference. I also want to protect the user against possible typos during entry.
Opinions ?
I've attached a parklist (technically a parkPrefixList) that I've pulled from https://pota.app/#/parklist
One idea would be to simply see if the park in the log is a member of parklist. I'm sure pota has some code somewhere that handles this - not sure if they are keen to share it...
I came across this endpoint: https://pota.app/all_parks_ext.csv on the POTA Discord channel pota-public-api it will give you a full CSV of all the current parks.
Making a lookup of the park reference in a database or list would add a brittle and unecessary level of complexity to the program. I went on the simplification of the Pota prefix parsing rule. This is the updated rule "The syntax is: AA-CCCCC: AA = national prefix, CCCCC = 4 or 5-digit numeric code (e.g. ON-00001). The national prefix is composed of letters and digits and is of at least 1 char and at most 5 char length."
Making a lookup of the park reference in a database or list would add a brittle and unecessary level of complexity to the program. I went on the simplification of the Pota prefix parsing rule. This is the updated rule "The syntax is: AA-CCCCC: AA = national prefix, CCCCC = 4 or 5-digit numeric code (e.g. ON-00001). The national prefix is composed of letters and digits and is of at least 1 char and at most 5 char length."
This is most reasonable. This program is mearly a tool, parser.. It should not do the job of other services i.e. full pota reference validation. If the POTA log parser throws an error of invalid park reference, it is up to the operator to fix that and reupload. This is just for "you forgot a dash in park reference"......
Completely reasonable solution. Thanks!
Despite the successive corrections, the POTA validation routine/regexp still fails on valid references (see test file provided by @yu3fms in issue #108 )