google / google/open-location-code
CW222222+22 python decode reject but C and google maps say 70,180
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 530
- PR merge metrics
- No merged PRs in 30d
Description
The Python version of decode treats some edge cases
differently from other implementations, for example C and google maps.
For example openlocationcode.py olc.decode('CW222222+22') gives
~/.local/lib/python3.11/site-packages/openlocationcode/openlocationcode.py", line 341, in decode
raise ValueError(
ValueError: Passed Open Location Code is not a valid full code - CW222222+22
Whereas C:
with argv[1] as CW222222+22
OLC_CodeArea code_area;
OLC_Decode(argv[1], 0, &code_area);
printf("%.18f,%.18f\n",code_area.lo.lat, code_area.lo.lon);
gives: 70.000000000000000000,180.000000000000000000
Similarly google maps accepts CW222222+22
(and appears to convert it to C2222222+22)
Python 3.11.5
gcc version 11.5.0
Linux Rocky 9
google maps Ubuntu Firefox 149.0.2
Bill
Contributor guide
Assessment
This issue has not been assessed yet.