google / google/open-location-code

Validation logic is inconsistent across languages

Open
#751 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
4.4k
Forks
530
PR merge metrics
No merged PRs in 30d

Description

There are two instances I found where validation logic for codes is inconsistent across languages:

1. Automatically expanding requested short code length if odd. Most of the
language implementations automatically add 1 to the length of requested codes
if the length indicates it is in the pair part of the code. Java, C++, Python,
and Javascript are the outliers.

2. Validate latitude and longitude bounds within validation logic for full
codes. Most of the language implementations only check the first two characters
for latitude/longitude bounds when within the validation logic for full codes,
not when generally checking if codes are valid. This does introduce a strange
case where a code is "valid", but is neither a valid short nor a valid long
code. C++ is the outlier here.

I have a PR out to fix this:

https://github.com/google/open-location-code/pull/750

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.