OpenLocationCode.encode

Creates Open Location Code.

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

Parameters

buffer ubyte[]

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

latitude double

The latitude in decimal degrees.

longitude double

The longitude in decimal degrees.

codeLength 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