Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an internal max plus code length to all OLC implementations #190

Closed
zongweil opened this issue Aug 31, 2018 · 3 comments
Closed

Add an internal max plus code length to all OLC implementations #190

zongweil opened this issue Aug 31, 2018 · 3 comments
Assignees

Comments

@zongweil
Copy link
Contributor

As discussed in this thread, we will internally process a max of 15 digits when encoding/decoding plus codes. This provides ~1cm x 0.5cm precision and will prevent the underflow errors mentioned in #12.

Specifically, the following changes will be made:

  • If you ask the library to encode a lat/long with more than 15 digits, the library will return a plus code with 15 digits.
  • If you ask the library to decode a plus code with more than 15 digits, the library will only take the first 15 digits into account with the returned code area.
  • Plus codes with more than 15 digits will be treated as valid if all the other validity constraints are satisfied. If the plus code has an invalid character after the 15th digit, it will be treated as invalid.

This issue tracks the work of updating all the OLC libraries.

@zongweil zongweil self-assigned this Aug 31, 2018
zongweil pushed a commit that referenced this issue Sep 2, 2018
* Limit max code length to 15 as specified in #190

* add encoding test case for code length limit

* revert new test cases, include them only for Go

* document truncating to 15 digits

* fix typo in documentation of Decode
zongweil referenced this issue in curbmap/OpenLocationCode-swift Oct 27, 2018
@gonzus
Copy link
Contributor

gonzus commented Nov 2, 2018

Maybe you want to reference PR #220 for the C implementation.

@WilliamDenniss
Copy link
Contributor

#300 validates that this has been implemented in all languages (and fixes the last few remaining issues).

@zongweil
Copy link
Contributor Author

Awesome! Marking this as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants