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.11k stars 476 forks source link

Specify algorithm for digit 11 and beyond #580

Open jidanni opened 7 months ago

jidanni commented 7 months ago

https://github.com/google/open-location-code/blob/main/docs/specification.md#code-precision mentions non-square areas starting at digit 11.

https://github.com/google/open-location-code/blob/main/docs/olc_definition.adoc also says

From 11 digits on, a different algorithm is used. The areas are slightly larger but the advantage is that the codes are shorter.

Alas, neither documents give any algorithm. Even what digit goes into what box is never explained.

bocops commented 7 months ago

The algorithm you are looking for is described in the Least significant five digits sections of the document.

jidanni commented 7 months ago

I see. It looked like two separate algorithms that one could choose from.

P.S., in addition to the English description, it would help a lot to see code samples. Else it is rather hard to be sure one is reading it OK.