The olc Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The olc Reference Manual

This is the olc Reference Manual, version 1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 05:46:22 2022 GMT+0.

Table of Contents


1 Introduction

#+TITLE: olc

This is a Common Lisp library to convert coordinates between Latitude/Longitude
and Open Location Code.

* API

In the library, latitude and longitude are represented by real numbers
(degrees), positive for northern latitude and eastern longitudes, and negative
for southern latitude and western longitudes.


#+BEGIN_SRC lisp
(lat/lon->olc latitude longitude &optional extra-precision) -> string
#+END_SRC

Return the Open Location Code for the given /latitude/ and /longitude/. If
/extra-precision/ is not ~nil~, an 11 digit code will be returned instead of
a 10 digit one.


#+BEGIN_SRC lisp
(olc->lat/lon code &optional center-p) -> list
#+END_SRC

Return the latitude and longitude for the southwest corner of the given
Open Location /Code/ square, or the center of the square if /center-p/ is
not ~nil~.

* Examples

Load the library:

#+BEGIN_SRC lisp
> (asdf:load-system "olc")
...
#+END_SRC


Get the Open Locator Code for the Nairobi Youth Sports Organization and
Information Centre in Kibera, Nairobi:

#+BEGIN_SRC lisp
> (olc:lat/lon->olc -1.314121 36.798829 t)
"6GCRMQPX+9G4"
#+END_SRC


Get back the latitude and longitude of the Nairobi Youth Sports Organization
and Information Centre in Kibera, Nairobi:

#+BEGIN_SRC lisp
> (olc:olc->lat/lon "6GCRMQPX+9G4" t)
(-1.3141125000000042d0 36.798828125d0)
#+END_SRC

* Tests

The tests require the /fiveam/ library.

#+BEGIN_SRC lisp
(asdf:test-system "olc")
#+END_SRC


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 olc

Convert coordinates between Latitude/Longitude and Open Location Code.

Author

Guillaume Le Vaillant

License

GPL-3

Version

1.0

Source

olc.asd.

Child Component

olc.lisp (file).


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 olc/olc.asd

Source

olc.asd.

Parent Component

olc (system).

ASDF Systems

olc.


Previous: , Up: Lisp   [Contents][Index]

3.1.2 olc/olc.lisp

Source

olc.asd.

Parent Component

olc (system).

Packages

olc.

Public Interface

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 olc

Source

olc.lisp.

Use List

common-lisp.

Public Interface

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Ordinary functions

Function: lat/lon->olc (latitude longitude &optional extra-precision)

Return the Open Location Code for the given LATITUDE and LONGITUDE.

Package

olc.

Source

olc.lisp.

Function: olc->lat/lon (code &optional center-p)

Return the latitude and longitude for the southwest corner of the given Open Location Code square, or the center of the square if CENTER-P is not NIL.

Package

olc.

Source

olc.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables