OpenLocationCode

Represents an open location code.

Members

Functions

code
string code()
Undocumented in source. Be warned that the author may not have intended to support it.
contains
bool contains(double latitude, double longitude)

Returns whether the bounding box specified by the Open Location Code contains provided point.

containsTrustedFull
bool containsTrustedFull(double latitude, double longitude)

Returns whether the bounding box specified by the Open Location Code contains provided point.

decode
OpenLocationCodeArea decode()

Decodes this object into a OpenLocationCodeArea object encapsulating latitude/longitude bounding box. This method doesn't allocate when not throwing an exception.

decodeTrustedFull
OpenLocationCodeArea decodeTrustedFull()

Decodes this object into a OpenLocationCodeArea object encapsulating latitude/longitude bounding box. This method doesn't allocate when not throwing an exception.

isFull
bool isFull()

Returns whether this OpenLocationCode is a full Open Location Code.

isPadded
bool isPadded()

Returns whether this OpenLocationCode is a padded Open Location Code, meaning that it contains less than 8 valid digits.

isShort
bool isShort()

Returns whether this OpenLocationCode is a short Open Location Code.

recover
OpenLocationCode recover(double referenceLatitude, double referenceLongitude)

Recover the nearest match (if the code was a short code) representing a full Open Location Code from this (short) Open Location Code, given the reference location.

shorten
OpenLocationCode shorten(double referenceLatitude, double referenceLongitude)

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.

shortenTrustedFullNoPad
OpenLocationCode shortenTrustedFullNoPad(double referenceLatitude, double referenceLongitude)

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. Assumes this is a full code which isn't padded.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

decode
OpenLocationCodeArea decode(string code)

Decodes this object into a OpenLocationCodeArea object encapsulating latitude/longitude bounding box. This method doesn't allocate when not throwing an exception.

encode
OpenLocationCode encode(double latitude, double longitude, int codeLength)
ubyte[] encode(ubyte[] buffer, double latitude, double longitude, int codeLength)

Creates Open Location Code.

fromString
OpenLocationCode fromString(string code)

Creates Open Location Code object for the provided code.

fromTrustedString
OpenLocationCode fromTrustedString(string code)

Creates Open Location Code object for the provided code performing no validation. This should call isValidCode before and abort if not valid.

Meta