This is the open-location-code Reference Manual, version 2.2.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:12:05 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
open-location-code
Open Location Code library.
Ralph Schleicher <rs@ralph-schleicher.de>
Modified BSD License
2.2.1
alexandria
(system).
iterate
(system).
open-location-code.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
open-location-code/open-location-code.asd
open-location-code
(system).
open-location-code/open-location-code.lisp
open-location-code
(system).
center
(generic function).
code-area
(class).
code-error
(condition).
code-length
(generic function).
code-length-error
(condition).
decode
(function).
encode
(function).
full-code-error
(condition).
fullp
(function).
invalid-code-error
(condition).
north-east-corner
(generic function).
pad-characters
(generic function).
precision
(generic function).
recover
(function).
separator-position
(generic function).
short-code-error
(condition).
shorten
(function).
shortp
(function).
south-west-corner
(generic function).
validp
(function).
+alphabet+
(constant).
+area-height+
(constant).
+area-width+
(constant).
+block-divisor+
(constant).
+grid-columns+
(constant).
+grid-rows+
(constant).
+maximum-length+
(constant).
+maximum-precision+
(constant).
analyse
(function).
area-size
(function).
defconst
(macro).
defsubst
(macro).
digit
(function).
digitp
(function).
length-from-precision
(function).
normalize-location
(function).
normalize-location*
(function).
precision-from-length
(function).
Packages are listed by definition order.
open-location-code
Open Location Code is a location encoding system for addresses,
independent of street names and building numbers.
See <https://plus.codes>.
olc
common-lisp
.
iterate
.
center
(generic function).
code-area
(class).
code-error
(condition).
code-length
(generic function).
code-length-error
(condition).
decode
(function).
encode
(function).
full-code-error
(condition).
fullp
(function).
invalid-code-error
(condition).
north-east-corner
(generic function).
pad-characters
(generic function).
precision
(generic function).
recover
(function).
separator-position
(generic function).
short-code-error
(condition).
shorten
(function).
shortp
(function).
south-west-corner
(generic function).
validp
(function).
+alphabet+
(constant).
+area-height+
(constant).
+area-width+
(constant).
+block-divisor+
(constant).
+grid-columns+
(constant).
+grid-rows+
(constant).
+maximum-length+
(constant).
+maximum-precision+
(constant).
analyse
(function).
area-size
(function).
defconst
(macro).
defsubst
(macro).
digit
(function).
digitp
(function).
length-from-precision
(function).
normalize-location
(function).
normalize-location*
(function).
precision-from-length
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Decode an Open Location Code.
Argument CODE is an Open Location Code (a string).
Primary value is a ‘code-area’ object. Secondary value is ‘:full’ or
‘:short’ if CODE is a full or short Open Location Code respectively.
If CODE is a full Open Location Code the code area denotes absolute
coordinates. Otherwise, the code area denotes relative coordinates,
i.e. offset values in the enclosing block.
Signal an ‘invalid-code-error’ if CODE is not a valid Open Location Code.
Encode a location into an Open Location Code.
First argument LATITUDE and second argument LONGITUDE denote the
location in degree angle. The latitude is clipped to the closed
interval [-90, 90] and the longitude is normalized to the
half-closed interval [-180, 180).
Optional third argument PRECISION is the precision of the code.
Default is five, i.e. a code length of ten digits.
Value is a full Open Location Code (a string).
The relation between precision, code length, and code area size
is depicted in the following table.
Precision | Code Length | Width / m | Height / m
————-+————-+—————+—————
1 | 2 | 2218929.9 | 2218929.9
2 | 4 | 110946.5 | 110946.5
3 | 6 | 5547.3 | 5547.3
4 | 8 | 277.4 | 277.4
5 | 10 | 13.9 | 13.9
6 | 11 | 3.47 | 2.77
7 | 12 | 0.867 | 0.555
8 | 13 | 0.217 | 0.111
9 | 14 | 0.0542 | 0.0222
10 | 15 | 0.0135 | 0.00444
The code length is equal to the number of Open Location Code digits. Pad characters and the separator character ‘+’ are not part of the code length. The code area dimensions are calculated with a mean earth radius of 6356766 m for a code area at the equator.
True if an object is a valid full Open Location Code.
Argument CODE is an object of any type.
Value is true if CODE is a valid full Open Location Code. Otherwise, value is null.
Recover a full Open Location Code from a short code
and a reference location.
First argument CODE is an Open Location Code (a string).
Second argument LATITUDE and third argument LONGITUDE denote the
reference location in degree angle. The latitude is clipped to
the closed interval [-90, 90] and the longitude is normalized to
the half-closed interval [-180, 180).
Value is the recovered full code. If CODE is already a full code,
return CODE as is.
Signal an ‘invalid-code-error’ if CODE is not an Open Location Code.
Remove four, six, or eight digits from the front of a full Open
Location Code given a reference location.
First argument CODE is a full Open Location Code (a string).
Second argument LATITUDE and third argument LONGITUDE denote the
reference location in degree angle. The latitude is clipped to
the closed interval [-90, 90] and the longitude is normalized to
the half-closed interval [-180, 180).
Value is the short code, or the original full code if the reference
location is too far.
Signal a ‘full-code-error’ if CODE is not a full Open Location Code.
True if an object is a valid short Open Location Code.
Argument CODE is an object of any type.
Value is true if CODE is a valid full Open Location Code. Otherwise, value is null.
True if an object is a valid sequence of Open Location Code characters.
Argument CODE is an object of any type.
Value is ‘:full’ or ‘:short’ if CODE is a valid full or short Open Location Code respectively. Otherwise, value is null.
Return the center latitude and longitude as multiple values.
Return the Open Location Code length.
integer
)) ¶Return the code length as a function of the precision.
Return the upper latitude and longitude as multiple values. The upper bounds are not included in the code area except for the north pole.
Return the number of pad characters.
Return the Open Location Code precision.
integer
)) ¶Return the precision as a function of the code length.
Return the position of the separator character.
Return the lower latitude and longitude as multiple values.
Base class for all Open Location Code errors.
type-error
.
Condition for an invalid Open Location Code length.
Condition for an invalid full Open Location Code.
Condition for an invalid Open Location Code.
Condition for an invalid short Open Location Code.
Area covered by an Open Location Code.
Lower latitude of the code area in degree angle.
real
0
Lower longitude of the code area in degree angle.
real
0
Height of the code area in degree angle.
real
0
Width of the code area in degree angle.
real
0
Precision of the original code.
fixnum
0
Code length of the original code.
common-lisp
.
fixnum
0
Position of the separator character in the original code.
fixnum
0
Number of pad characters in the original code.
fixnum
0
Set of valid digits, i.e. encoding characters. The character position is equal to the decimal value, i.e. weight, of the digit.
Vector of code area heights in descending order. Element position is the precision of the code area.
Vector of code area widths in descending order. Element position is the precision of the code area.
Divisor when splitting a block into sub-blocks.
Number of grid columns.
Number of grid rows.
Maximum code length excluding the plus sign character.
Maximum number of discretization steps.
Define a constant variable.
This is like ‘defconstant’ except that the initially set value is reused when the ‘defconst’ form is evaluated again.
Define an inline function.
This is like ‘defun’ except that the function is globally marked for inline expansion by the compiler.
Analyse an Open Location Code.
First argument CODE is the Open Location Code (an object).
If optional second argument AREA is non-null, secondary value
is a code area object.
Primary value is ‘:full’ or ‘:short’ if CODE is a valid full or short Open Location Code respectively. Otherwise, all values are null.
Return the height and width of a code area as multiple values.
Argument PRECISION is the number of discretization steps.
Return the digit for a decimal value.
Argument VALUE has to be a non-negative integer less than 20.
Value is the digit, i.e. encoding character.
True if CHAR is a valid digit.
Argument CHAR has to be a character.
Value is the decimal value, i.e. weight, of the digit, or null if CHAR is an invalid digit.
Return the code length as a function of the precision.
Clip LATITUDE to the half-closed interval [-90, 90) and
normalize LONGITUDE to the half-closed interval [-180, 180).
Third argument PRECISION is used to determine the height of
the code area if LATITUDE denotes the north pole.
Values are latitude, longitude, and the actual precision.
Like ‘normalize-location’ but return latitude and longitude as non-negative numbers, i.e. add 90° to the latitude and 180° to the longitude.
Return the precision as a function of the code length.
Jump to: | A C D E F G L M N P R S V |
---|
Jump to: | A C D E F G L M N P R S V |
---|
Jump to: | +
C H L P S W |
---|
Jump to: | +
C H L P S W |
---|
Jump to: | C F I O P S |
---|
Jump to: | C F I O P S |
---|