How to emulate Plus Codes offline?

Viewed 62

It is easy to encode/decode OLC geocodes because it has a good definition and we can also clone a good implementation (e.g. Java). So, I can, for example, build a offline service (e.g. for my Intranet) that encode/decode OLC codes...
But, when we talk about encode/decode "short codes" a good specification it is not enough: I need some kind of lookup table that transforms names into OLC prefixes, and exactly in the same way that PlusCodes does. I'm not finding the "official dataset" or the algorithm it used.

Suppose the short code "598P+Q36 Itagui, Antioquia, Colombia", that was translated by PlusCodes as 67R6598P+Q36, where 67R6 is the translated prefix and 598P+Q36 the original suffix,

enter image description here

Is it possible to emulate this "Name to prefix" black box?

Or, in terms of implementation, are a free database, like GeoName, where we can get the lookup table of a country? ...Is the PlusCodes service reproducible?


NOTES

Answring @fas. The Guidance for shortening codes specify when "you can eliminate the first four digits of the code", but, it is a first problem: it is not possible to use this algorithm when the distance of the center of the city is greater "than 0.4 degrees latitude and 0.4 degrees longitude".

The @fas's "straightforward approach" it is not possible in big-area cities like Bogota or Altamira. What PlusCodes do is to "invent" non-city extra names as reference. Examples:

... And even in small cities the problem occurs:

A second problem in the approach is about "name simplification" or "PlusCodes naming conventions" (which is not always the "country's official name convention").

Typical example (from here): "764Q+Q7 Louisville, Kentucky" reconstructs to 86CP764Q+Q7; while "764Q+Q7 Kentucky" use another prefix, it reconstructs to 86CQ764Q+Q7, because that is closer to the center of Kentucky.

In big-area cities PlusCodes use neighborhood name or allotment name or any arbitrary name, in general no "official name" for that place. There are no algorithm or "official plus codes specification" about it (exists?). We need open data to understand naming conventions.


The Google/PlusCodes website say that PlusCodes is open, so this is my working hypothesis here.

0 Answers
Related