Many geocodes, such as Geohash and OLC (Open Location Code), can be reduced by a context reference, as described here and here.
For example:
Being able to say
WF8Q+WF, Cape Verde, Praia
is significantly easier than remembering and
using796RWF8Q+WF
The resolver software take "Cape Verde, Praia" (or ISO abbreviation CV
instead Cape Verde) and transforms it into a code prefix... The resolver make use of something like a lookup table,
Prefix | Country | Name (replaces prefix) | Reference is it?
-------+---------+------------------------+------------------
796R | CV | Praia | 796RWFMP ?
796R | CV | Joao Varela | 796RXC4C ?
797R | CV | Cruz do Gato | 797R3F38 ?
... | ... | ... | ...
I am supposing that the hidden (black box) algorithm do something simple, based on an official lookup table like the illustrated above. It use prefix of the lookup table to translate short code into complete code, or the inverse:
Translating short code to complete code. To retrieve the location from the OLC short code, just know the prefix.
Example: "WF8Q+WF, CV, Praia " will use the line ofCV | Praia
of lookup table, that informs the prefix796R
to resolve the code, concatenating prefix with suffix, "796R" with "WF8Q+WF".
It is like a functionrecoverNearest('WF8Q+WF', getReferencePoint_byText(lookup,"CV", "Praia"))
but Google/PlusCodes not published lookup dataset of Cape Verde.Translating complete code to short code. To show the short code from location (e.g. from
796RWF8Q+WF
), is necessary to check the "nearst reference" to resolve the spatial query — Joao Varela and Praia lines have same prefix, but Praia's reference, by796RWF
, matches better.
It is like a functionshorten('796RWF8Q+WF', getReferencePoint_byNearFrom(lookup,'796RWF8Q+WF'))
but Google/PlusCodes not published lookup dataset of Cape Verde.
Question: where official lookup table of Cape Verde?
NOTES
We can split in more questions to generalize:
Is plus.codes really a black box?
(perhaps I am using some wrong hypothesis on my explanation)The lookup table of a country like Cape Verde exist, and we can download it? where Google is publishing it?
The official lookup table of Cape Verde exists and Google is respecting it... where Cape Verde govern is publishing it?
More illustrations for readers that not understand the central problem:
Translation from complete code to short code. Suppose the prefix
796R
, when a complete code796Rxxxx+yy
is translated to "Praiaxxxx+yy
" and when is translated to "Joao Varelaxxxx+yy
"?
It is an arbitrary choice if you not have a table with the PlusCode official references.Translation from short code to complete code. Suppose that I am developing a Javascript software. The inputs are the short code
xxxx+yy
and a name (country and city or contry/state/city/district). Suppose only Cabo Verde country names, how to convert names into prefixes exactly as PlusCodes?
(edit after discussions) A preliminary conclusion. There are only two possible answers to the question:
show a link where PlusCodes published its name-to-prefix table;
show the source-code of an algorithm that reproduces exactly PlusCodes, that you developed by reengineering.
I supposed that the most simple algorithm use the ordinary OLC encode/decode, and a parser for translate names into prefixes (or vice-versa), based in an "official lookup table".