The mgrs Reference Manual

Table of Contents

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

The mgrs Reference Manual

This is the mgrs Reference Manual, version 1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 17:04:43 2021 GMT+0.


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

1 Introduction

#+TITLE: mgrs

This is a Common Lisp library to convert coordinates between Latitude/Longitude
and MGRS.

* 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->mgrs latitude longitude &optional precision) -> string
#+END_SRC

Return the MGRS locator for the given /latitude/ and /longitude/. The
/precision/ (in meters) of the locator can be 1, 10, 100, 1000, 10000.


#+BEGIN_SRC lisp
(mgrs->lat/lon locator) -> list
#+END_SRC

Return the latitude and longitude for the southwest corner of the given
MGRS /locator/ square.

* Examples

Load the library:

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


Get the MGRS locator of Munich:

#+BEGIN_SRC lisp
> (mgrs:lat/lon->mgrs 48.146660d0 11.60833d0)
"32UPU9401035891"
#+END_SRC


Same thing with a lower precision (100 meters):

#+BEGIN_SRC lisp
> (mgrs:lat/lon->mgrs 48.146660d0 11.60833d0 100)
"32UPU940358"
#+END_SRC


Get back the latitude and longitude of Munich:

#+BEGIN_SRC lisp
> (mgrs:mgrs->lat/lon "32UPU9401035891")
(48.146655723267834d0 11.60832570541976d0)
#+END_SRC

* Tests

The tests require the /fiveam/ library.

#+BEGIN_SRC lisp
(asdf:test-system "mgrs")
#+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 mgrs

Author

Guillaume Le Vaillant

License

GPL-3

Description

Convert coordinates between Latitude/Longitude and MGRS.

Version

1.0

Dependency

utm-ups

Source

mgrs.asd (file)

Component

mgrs.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 mgrs.asd

Location

mgrs.asd

Systems

mgrs (system)


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

3.1.2 mgrs/mgrs.lisp

Parent

mgrs (system)

Location

mgrs.lisp

Packages

mgrs

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 mgrs

Source

mgrs.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

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

5 Definitions

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


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

5.1 Exported definitions


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

5.1.1 Functions

Function: lat/lon->mgrs LATITUDE LONGITUDE &optional PRECISION

Return the MGRS locator for the given LATITUDE and LONGITUDE. The PRECISION (in meters) of the locator can be 1, 10, 100, 1000, 10000.

Package

mgrs

Source

mgrs.lisp (file)

Function: mgrs->lat/lon LOCATOR

Return the latitude and longitude for the southwest corner of the given MGRS LOCATOR square.

Package

mgrs

Source

mgrs.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: false-easting BAND

Return the false easting for a UPS BAND.

Package

mgrs

Source

mgrs.lisp (file)

Function: false-northing BAND

Return the false northing for a UPS BAND.

Package

mgrs

Source

mgrs.lisp (file)

Function: letter N

Return the letter associated to number N.

Package

mgrs

Source

mgrs.lisp (file)

Function: letter-position C

Return the number associated to letter C.

Package

mgrs

Source

mgrs.lisp (file)

Function: mgrs/ups->lat/lon NORTHP BAND SQUARE-X SQUARE-Y EASTING NORTHING

Return tle latitude and longitude for the given MGRS coordinates.

Package

mgrs

Source

mgrs.lisp (file)

Function: mgrs/utm->lat/lon ZONE BAND SQUARE-X SQUARE-Y EASTING NORTHING

Return tle latitude and longitude for the given MGRS coordinates.

Package

mgrs

Source

mgrs.lisp (file)

Function: minimum-northing BAND

Return the minimum northing of a UTM BAND.

Package

mgrs

Source

mgrs.lisp (file)

Function: ups->mgrs NORTHP BAND EASTING NORTHING PRECISION

Return the MGRS locator for the given UPS coordinates.

Package

mgrs

Source

mgrs.lisp (file)

Function: utm->mgrs ZONE BAND EASTING NORTHING PRECISION

Return the MGRS locator for the given UTM coordinates.

Package

mgrs

Source

mgrs.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   M  
Index Entry  Section

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

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

M
mgrs.asd: The mgrs․asd file
mgrs/mgrs.lisp: The mgrs/mgrs․lisp file

Jump to:   F   L   M  

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

A.2 Functions

Jump to:   F   L   M   U  
Index Entry  Section

F
false-easting: Internal functions
false-northing: Internal functions
Function, false-easting: Internal functions
Function, false-northing: Internal functions
Function, lat/lon->mgrs: Exported functions
Function, letter: Internal functions
Function, letter-position: Internal functions
Function, mgrs->lat/lon: Exported functions
Function, mgrs/ups->lat/lon: Internal functions
Function, mgrs/utm->lat/lon: Internal functions
Function, minimum-northing: Internal functions
Function, ups->mgrs: Internal functions
Function, utm->mgrs: Internal functions

L
lat/lon->mgrs: Exported functions
letter: Internal functions
letter-position: Internal functions

M
mgrs->lat/lon: Exported functions
mgrs/ups->lat/lon: Internal functions
mgrs/utm->lat/lon: Internal functions
minimum-northing: Internal functions

U
ups->mgrs: Internal functions
utm->mgrs: Internal functions

Jump to:   F   L   M   U  

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

A.3 Variables


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

A.4 Data types

Jump to:   M   P   S  
Index Entry  Section

M
mgrs: The mgrs system
mgrs: The mgrs package

P
Package, mgrs: The mgrs package

S
System, mgrs: The mgrs system

Jump to:   M   P   S