question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calculated Coordinates: coordinates are not parsed as expected by Geocachers

See original GitHub issue

Current 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' with A=2, B=3, C = 5 results in N50° 8.2' (where 8.2 = 00.2 + 3 + 5) instead of N50° 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:closed
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
ztNFnycommented, Jan 10, 2022

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

1reaction
eddiemuccommented, Jan 10, 2022

It was not quite clear to me in the end whether this should also happen for degrees - and if yes whether to do it to 5 or 6 decimal places. I would rather NOT do leading zeros for degress (just for minutes and seconds)

Imho we MUST pad those places where it makes a difference (decimal minutes in DMM format), all other places are optional but should be consistent to avoid confusion.

Consider the simple example N48.X° assuming X=6. Should this now be

  • N48.6° (no leading zeros)
  • N48.00006° (leading zeros, 5 digits)
  • N48.000006° (leading zeros, 6 digits)

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Variables and calculated Waypoints] enhance featureset of Formula ...
Calculated coordinates use an own parser build on top of this to parse coordinates. This syntax is not documented yet (ToDo), but generally...
Read more >
Release Notes (Website: Solution Checker) - October 19, 2017
A Mystery Cache's final coordinates are tied to the solution checker. If the finder submits the correct coordinates to the checker, ...
Read more >
FAQ - Project-GC
How does corrected coordinates work? Project-GC primarily parses your personal cache notes at Geocaching.com for corrected coordinates. This is ...
Read more >
Taiwan - Geocaching.com Wiki
It can be blank, except for the coordinates. This reserves your location. Post a reviewer note and explain which questions you have. In...
Read more >
FAQ - c:geo
Maps.me is no longer working when started from c:geo! ... you to record and average coordinates for your new cache (e.g. GPS Averaging...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found