Skip to content

CW222222+22 python decode reject but C and google maps say 70,180 #759

@wblangdon

Description

@wblangdon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions