regular expression for LINE_1_PATTERN needs modification to include ancient data
For example, I attached one downloaded from https://celestrak.com/.
In the line 35, 39, 43 and some others, the 34-th char is a "0", which
should be [ +-] in modern days.
Also, in these lines, the International Designator is missing as
blanks.
I tried to modify the expression as:
The regular expression used when parsing TLE data does not work on some
historical TLE data.
Pattern.compile("1 [ 0-9]{5}[ A-Z] [ 0-9]{5}[ A-Z]{3} [
0-9]{5}[.][ 0-9]{8} (?:(?:[ 0*-][.][ 0-9]{8})|(?:
[*-][.][ 0-9]{7})) " +
"[ +][ 0-9]{5}[*][ 0-9] [ +][ 0-9]{5}[*][
0-9] [ 0-9] [ 0-9]{4}[ 0-9]");
private static final Pattern LINE_1_PATTERN =I changed ther first [A-Z] to [ A-Z], the first [ +] to [
0+].
Fortunately it works now for these ancient data.
I think you can check the correction of these expressions, and include
them in the future version, since I suppose it won't cause other
mistakes.
P.S. Is the TLE package still under developing? I found many inconvience when using it. For example:
- During the parsing, the wrong TLE is all returned with a boolean FALSE, but I have to change it to some different negative integers to identifiy what happens to my data.
- Also the ignored lines are not recorded anywhere, so I have to output them by myself to find the wrong data, or the wrong code.
- Also there are many confusions about the TLESeries, but I'm afraid I have not time to summarize them all, at least before August. But I will try to do it if the problem still exists at then.
Thanks.
(from redmine: issue id 330, created on 2017-03-21, closed on 2017-07-27)
- Uploads: