The olc Reference Manual

Table of Contents

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

The olc Reference Manual

This is the olc Reference Manual, version 1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 05:42:25 2022 GMT+0.


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

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


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

2 Systems

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


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

2.1 olc

Author

Guillaume Le Vaillant

License

GPL-3

Description

Convert coordinates between Latitude/Longitude and Open Location Code.

Version

1.0

Source

olc.asd (file)

Component

olc.lisp (file)


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

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 files   [Contents][Index]

3.1.1 olc.asd

Location

olc.asd

Systems

olc (system)


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

3.1.2 olc/olc.lisp

Parent

olc (system)

Location

olc.lisp

Packages

olc

Exported Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 olc

Source

olc.lisp (file)

Use List

common-lisp

Exported Definitions

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

5 Definitions

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


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

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 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 (file)

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 (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   O  
Index Entry  Section

F
File, Lisp, olc.asd: The olc․asd file
File, Lisp, olc/olc.lisp: The olc/olc․lisp file

L
Lisp File, olc.asd: The olc․asd file
Lisp File, olc/olc.lisp: The olc/olc․lisp file

O
olc.asd: The olc․asd file
olc/olc.lisp: The olc/olc․lisp file

Jump to:   F   L   O  

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

A.2 Functions

Jump to:   F   L   O  
Index Entry  Section

F
Function, lat/lon->olc: Exported functions
Function, olc->lat/lon: Exported functions

L
lat/lon->olc: Exported functions

O
olc->lat/lon: Exported functions

Jump to:   F   L   O  

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

A.3 Variables


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

A.4 Data types

Jump to:   O   P   S  
Index Entry  Section

O
olc: The olc system
olc: The olc package

P
Package, olc: The olc package

S
System, olc: The olc system

Jump to:   O   P   S