Calculated Coordinates: coordinates are not parsed as expected by Geocachers
See original GitHub issueCurrent Coordinate parser is pretty simple: it parses coordinates from left to right, each formula it finds is considered to result in degree / minute / second decimal value depending on position and follow-up charater (°, ’ or ").
This results in some behavior unexpected to geocachers. This is especially true for the NDD MM.MMM format. For example:
N50°00.A+B+C'
withA=2, B=3, C = 5
results inN50° 8.2'
(where 8.2 = 00.2 + 3 + 5) instead ofN50° 00.010'
(which would be expected by geocachers).- Something like
N214°
parses correctly even though the degree value is totally out of range
On dev meeting on 9.1.22 we discussed the following measurements:
1) Parse parts before and after decimal point as separate formulas
Evaluate both parts to integers (round up if is is a float value, throw an error if this is not possible) then concatenate them
Doing this N50°00.A+B+C'
with A=2, B=3, C = 5
will then result in N50°00.10'
2) add leading zeros to minute decimal part
If a coordinate part is identified to be a minute value and the part after decimal point is less than 3 digits long then it is filled up with leading 0 filled up
Doing this (combined with the first measurement) N50°00.A+B+C'
with A=2, B=3, C = 5
will then result in N50°00.010'
(note the leading 0 before 10)
3) Evaluate coordinate for correct value ranges.
For example latitude shall not be outside +/-90 degree.
This issue is used to track implementation of the above. There were other measurements discussed at the dev meeting. For discussion of those I open another issue #12512
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top GitHub Comments
What I meant to say: DMM -> the decimal minutes MUST be padded, everything else optional DMS -> everything optional (as 50° 1’ 1" == 50° 01’ 01") DD -> nothing should be padded as 50.1 and 50.01 are different but there’s no to know the expected precision
Consider the simple example N48.X° assuming X=6. Should this now be
In my impression there was no clear solution which case to use in the linked discussion above. The pros and cons are pretty clear (first one is inconsistent to leading-zero-handling with minutes and seconds), but in contrast to minutes/seconds it is hard to define for degrees to how many digits one should trail with zeros (5 or 6 or something else?).
I personally would thus use solution 1 (no trailing zeros for degree) although it is not consistent with handling of minutes/seconds. In contrast to minutes/seconds I don’t feel there’s a “common agreement” among geocachers on how many after-digits a degree should have.