OpenLocationCode.encode

Creates Open Location Code.

  1. OpenLocationCode encode(double latitude, double longitude, int codeLength = codePrecisionNormal)
  2. ubyte[] encode(scope return ubyte[] buffer, double latitude, double longitude, int codeLength = codePrecisionNormal)
    struct OpenLocationCode
    pure static
    ubyte[]
    encode
    nothrow
    (
    scope return ubyte[] buffer
    ,
    double latitude
    ,
    double longitude
    ,
    )

Parameters

buffer
Type: ubyte[]

The character buffer to write to. (ASCII only = ubyte[]) Should be at least maxOLCLength in size to avoid crashes.

latitude
Type: double

The latitude in decimal degrees.

longitude
Type: double

The longitude in decimal degrees.

codeLength
Type: int

The desired number of digits in the code. Defaults to the default precision. Must be a valid code length, otherwise contract violation = assertion error.

Meta