OpenLocationCode.shorten

Returns short OpenLocationCode from the full Open Location Code created by removing four or six digits, depending on the provided reference point. It removes as many digits as possible.

struct OpenLocationCode
pure const
shorten

Parameters

referenceLatitude double

Reference point latitude degrees.

referenceLongitude double

Reference point longitude degrees.

Return Value

A short code if possible or OpenLocationCode.init if it is too far away.

Throws

OLCFormatException if this is not called on a valid full code or called on a padded code.

Meta