google / open-location-code

Open Location Code is a library to generate short codes, called "plus codes", that can be used as digital addresses where street addresses don't exist.
https://plus.codes
Apache License 2.0
4.06k stars 471 forks source link

Short Codes specification can generate ambiguous codes #483

Closed dudz1978 closed 1 year ago

dudz1978 commented 2 years ago

OLC specification of short codes:

Digits can be removed from the code, until the precision of the position is less than twice the maximum of the latitude or longitude offset between the code center and the reference location.

Reference location 0.0000625,0.0250625 and Plus Code 6FG22222+22 (coordinates of code center 0.0000625,0.0000625) have longitude offset 0.025, and twice its value is 0.05. Third pair (positions 5 and 6) has precision 1/20 = 0.05, so it could be removed (the precision is not less than twice of offset), generating short code 22+22. But the code 6FG22322+22 (coordinates 0.0000625,0.0500625) has same absolute value offset, so code 22+22 is ambiguous.

Maybe the specification should be adjusted to handle these cases.