module PlusCode

Extended Modules

Defined in:

pluscode.cr
pluscode/code_area.cr
pluscode/open_location_code.cr

Constant Summary

CODE_ALPHABET = "23456789CFGHJMPQRVWX"

The character set used to encode coordinates.

DECODE = [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, -1, nil, nil, nil, nil, -1, nil, 0, 1, 2, 3, 4, 5, 6, 7, nil, nil, nil, nil, nil, nil, nil, nil, nil, 8, nil, nil, 9, 10, 11, nil, 12, nil, nil, 13, nil, nil, 14, 15, 16, nil, nil, nil, 17, 18, 19, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 8, nil, nil, 9, 10, 11, nil, 12, nil, nil, 13, nil, nil, 14, 15, 16, nil, nil, nil, 17, 18, 19]

ASCII lookup table.

LAT_GRID_PRECISION = 5_i64 ** (MAX_CODE_LENGTH - PAIR_CODE_LENGTH)

Precision of the latitude grid.

LNG_GRID_PRECISION = 4_i64 ** (MAX_CODE_LENGTH - PAIR_CODE_LENGTH)

Precision of the longitude grid.

MAX_CODE_LENGTH = 15

Maximum number of digits to process in a plus code.

PADDING = "0"

The character used to pad a code

PAIR_CODE_LENGTH = 10_i64

Maximum code length using lat/lng pair encoding. The area of such a code is approximately 13x13 meters (at the equator), and should be suitable for identifying buildings. This excludes prefix and separator characters.

PAIR_CODE_PRECISION = 8000_i64

Inverse of the precision of the pair code section.

SEPARATOR = "+"

A separator used to separate the code into two parts.

SEPARATOR_POSITION = 8

The max number of characters can be placed before the separator.