You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, recovering a short code to a full code does not return the nearest match.
Calling recoverNearest('22+', 14.9333, -23.5125) returns 796RXF22+. This is not correct - the nearest match is 796RXG22+.
The problem seems to be with the step where the reference latitude and longitude are rounded down before generating the candidate code. In the above example, it should generate a code whose center is at most .05 degrees from the reference location, but due to the rounding down it is .08 degrees away.
It appears that removing the rounding down step entirely fixes this.
The text was updated successfully, but these errors were encountered:
Some more detail. Rounding the reference location, can result in a padding section that is more than one cell away from the correct position. The reason this is happening is that the code is using Math.floor. Either changing this to Math.round, or removing it entirely, fixes the problem.
In some cases, recovering a short code to a full code does not return the nearest match.
Calling recoverNearest('22+', 14.9333, -23.5125) returns 796RXF22+. This is not correct - the nearest match is 796RXG22+.
The problem seems to be with the step where the reference latitude and longitude are rounded down before generating the candidate code. In the above example, it should generate a code whose center is at most .05 degrees from the reference location, but due to the rounding down it is .08 degrees away.
It appears that removing the rounding down step entirely fixes this.
The text was updated successfully, but these errors were encountered: