recover_olc {olctools} | R Documentation |
shorten_olc
(and other sources) shorten a code, reducing
the space it occupies. They also limit its ability to be translated back into latitude/longitude
pairs. recover_olc
recovers a full code from a shortened one, allowing it to be decoded with
decode_olc
. Some loss of accuracy or precision is expected - and as it finds
the closest match to the coordinates rather than to the original code, the characters may be very
different.
recover_olc(olcs, lats, longs)
olcs |
a vector of short open location codes, generated with |
lats |
a numeric vector of latitudes. |
longs |
a numeric vector of longitudes, equivalent in size to |
# Shorten an OLC and then recover the nearest full code. Note the actual characters differ. shortened_code <- shorten_olc("8FVC9G8F+6X", 47.5, 8.5); recovered_code <- recover_olc(shortened_code, 47.4, 8.6);