module PlusCode::OpenLocationCode

Overview

OpenLocationCode implements the Google Open Location Code(Plus+Codes) algorithm.

Extended Modules

Defined in:

pluscode/open_location_code.cr

Instance Method Summary

Instance Method Detail

def decode(code) #

Decodes an Open Location Code(Plus+Codes) into a [CodeArea].

@param code [String] a plus+codes @return [CodeArea] a code area which contains the coordinates


[View source]
def encode(latitude, longitude, code_length = PAIR_CODE_LENGTH) #

Converts a latitude and longitude into a Open Location Code(Plus+Codes).


[View source]
def full?(code) #

Determines if a string is a valid full Open Location Code(Plus+Codes).


[View source]
def recover_nearest(short_code, reference_latitude, reference_longitude) #

Recovers a full Open Location Code(Plus+Codes) from a short code and a reference location.


[View source]
def short?(code) #

Determines if a string is a valid short Open Location Code(Plus+Codes).


[View source]
def shorten(code, latitude, longitude) #

Removes four, six or eight digits from the front of an Open Location Code (Plus+Codes) given a reference location.


[View source]
def valid?(code) #

Determines if a string is a valid sequence of Open Location Code (Plus+Codes) characters.


[View source]