The utm-ups Reference Manual

Table of Contents

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

The utm-ups Reference Manual

This is the utm-ups Reference Manual, version 1.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 18:12:38 2021 GMT+0.


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

1 Introduction

#+TITLE: utm-ups

This is a Common Lisp library to convert coordinates between Latitude/Longitude
and UTM (Universal Transverse Mercator) or UPS (Universal Polar Stereographic).

* 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.

UTM zones are represented by positive integers for northern latitudes and
negative integers for southern latitudes.

UPS zones are either ~t~ for northen latitudes or ~nil~ for southern latitudes.

** Ellipsoids

#+BEGIN_SRC lisp
*ellipsoid*
#+END_SRC

Special variable containing the name of the ellipsoid that will be used in
computations ("WGS 84" by default).


#+BEGIN_SRC lisp
(ellipsoids) -> list
#+END_SRC

Return the list of supported ellipsoids.

** Main functions

#+BEGIN_SRC lisp
(lat/lon->utm-ups latitude longitude &optional zone) -> list, string
#+END_SRC

Return the UTM or UPS zone, easting and northing for the given /latitude/ and
/longitude/. The second returned value is the UTM or UPS band. The /zone/
parameter can be used to force in which UTM zone the coordinates will be
computed.


#+BEGIN_SRC lisp
(utm/ups->lat/lon zone easting northing) -> list
#+END_SRC

Return the latitude and longitude for the given UTM or UPS /zone/, /easting/
and /northing/.


#+BEGIN_SRC lisp
(band latitude longitude) -> string
#+END_SRC

Return the UTM or UPS band for the given /latitude/ and /longitude/.


#+BEGIN_SRC lisp
(format-utm/ups zone easting northing &optional band) -> string
#+END_SRC

Return UTM or UPS coordinates as a string. If /band/ is not specified, it will
be set to ~+~ for northern zones and to ~-~ for southern zones.


#+BEGIN_SRC lisp
(parse-utm/ups string) -> list
#+END_SRC

Return the UTM or UPS coordinates represented as a /string/.


#+BEGIN_SRC lisp
(format-lat/lon latitude longtude &optional decimal) -> string
#+END_SRC

Return the coordinates as a string. If /decimal/ is not ~nil~, decimal notation
will be used for angles, otherwise d°m's" notation will be used.


#+BEGIN_SRC lisp
(parse-lat/lon string) -> list
#+END_SRC

Return the latitude and longitude represented as a /string/.

** UTM specific functions

#+BEGIN_SRC lisp
(lat/lon->utm latitude longitude &optional zone) -> list, string
#+END_SRC

Return the UTM zone, easting and northing for the given /latitude/ and
/longitude/. The second returned value is the UTM band. The /zone/ parameter
can be used to force in which UTM zone the coordinates will be computed.


#+BEGIN_SRC lisp
(utm->lat/lon zone easting northing) -> list
#+END_SRC

Return the latitude and longitude for the given UTM /zone/, /easting/ and
/northing/.


#+BEGIN_SRC lisp
(utm-zone latitude longitude) -> integer
#+END_SRC

Return the UTM zone number for the given /latitude/ and /longitude/.


#+BEGIN_SRC lisp
(utm-band latitude) -> string
#+END_SRC

Return the UTM band for the given /latitude/.

** UPS specific functions

#+BEGIN_SRC lisp
(lat/lon->ups latitude longitude) -> list, string
#+END_SRC

Return the UPS hemisphere, easting and northing for the given /latitude/ and
/longitude/. The second returned value is the UPS band.


#+BEGIN_SRC lisp
(ups->lat/lon northp easting northing) -> list
#+END_SRC

Return the latitude and longitude for the given UPS hemisphere (/northp/),
/easting/ and /northing/.


#+BEGIN_SRC lisp
(ups-band latitude longitude) -> string
#+END_SRC

Return the UPS band for the given /latitude/ and /longitude/.

* Examples

Load the library:

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


Get the UTM coordinates of Madrid:

#+BEGIN_SRC lisp
> (utm-ups:lat/lon->utm/ups 40.433333d0 -3.7d0)
(30 440627.3875554724d0 4476089.9799552625d0)
"T"

> (utm-ups:format-utm/ups 30 440627.3875554724d0 4476089.9799552625d0 "T")
"30T 0440627 4476090"
#+END_SRC


Get back the latitude and longitude of Madrid:

#+BEGIN_SRC lisp
> (utm-ups:utm/ups->lat/lon 30 440627.3875554724d0 4476089.9799552625d0)
(40.433333001062145d0 -3.700000000011189d0)

> (utm-ups:format-lat/lon 40.433333001062145d0 -3.700000000011189d0)
"40°25'59.9\"N 3°42'00.0\"W"
#+END_SRC


Get the coordinates of the McMurdo station either in UTM or in UPS:

#+BEGIN_SRC lisp
> (utm-ups:lat/lon->utm -77.846389d0 166.668333d0)
(-58 539204.7698733974d0 1358215.357267417d0)
"C"

> (utm-ups:lat/lon->ups -77.846389d0 166.668333d0)
(NIL 2312265.8557648384d0 682275.9727717754d0)
"B"
#+END_SRC


Get back the latitude and longitude of the McMurdo station:

#+BEGIN_SRC lisp
> (utm-ups:utm/ups->lat/lon -58 539204.7698733974d0 1358215.357267417d0)
(-77.84638900680321d0 166.66833300105677d0)

> (utm-ups:utm/ups->lat/lon nil 2312265.8557648384d0 682275.9727717754d0)
(-77.84638899999842d0 166.668333d0)
#+END_SRC

* Tests

The tests require the /fiveam/ library.

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

Author

Guillaume Le Vaillant

License

GPL-3

Description

Convert coordinates between Latitude/Longitude and UTM or UPS.

Version

1.1

Source

utm-ups.asd (file)

Component

utm-ups.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 utm-ups.asd

Location

utm-ups.asd

Systems

utm-ups (system)


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

3.1.2 utm-ups/utm-ups.lisp

Parent

utm-ups (system)

Location

utm-ups.lisp

Packages

utm-ups

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 utm-ups

Source

utm-ups.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


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

5.1.1 Special variables

Special Variable: *ellipsoid*

Ellipsoid to use by default.

Package

utm-ups

Source

utm-ups.lisp (file)


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

5.1.2 Functions

Function: band LATITUDE LONGITUDE

Return the UTM or UPS band for the given LATITUDE and LONGITUDE.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: ellipsoids ()

Return the list of supported ellipsoids.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: format-lat/lon LATITUDE LONGITUDE &optional DECIMAL

Return the coordinates as a string. If DECIMAL is not NIL, decimal notation will be used for angles, otherwise d°m’s" notation will be used.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: format-utm/ups ZONE EASTING NORTHING &optional BAND

Return UTM or UPS coordinates as a string. If BAND is not specified, it will be set to "+" for northern zones and to "-" for southern zones.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: lat/lon->ups LATITUDE LONGITUDE

Return the UPS hemisphere, easting and northing for the given LATITUDE and LONGITUDE. The second returned value is the UPS band.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: lat/lon->utm LATITUDE LONGITUDE &optional ZONE

Return the UTM zone, easting and northing for the given LATITUDE and LONGITUDE. The second returned value is the UTM band. The ZONE parameter can be used to force in which UTM zone the coordinates will be computed.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: lat/lon->utm/ups LATITUDE LONGITUDE &optional ZONE

Return the UTM or UPS zone, easting and northing for the given LATITUDE and LONGITUDE. The second returned value is the UTM or UPS band. The ZONE parameter can be used to force in which UTM zone the coordinates will be computed.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: parse-lat/lon STRING

Return the latitude and longitude represented as a STRING.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: parse-utm/ups STRING

Return the UTM or UPS coordinates represented as a STRING.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: ups->lat/lon NORTHP EASTING NORTHING

Return the LATITUDE and LONGITUDE for the given UPS hemisphere, EASTING and NORTHING.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: ups-band LATITUDE LONGITUDE

Return the UPS band for the given LATITUDE and LONGITUDE.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: utm->lat/lon ZONE EASTING NORTHING

Return the latitude and longitude for the given UTM ZONE, EASTING and NORTHING.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: utm-band LATITUDE

Return the UTM band for the given LATITUDE.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: utm-zone LATITUDE LONGITUDE

Return the UTM zone number for the given LATITUDE and LONGITUDE.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: utm/ups->lat/lon ZONE EASTING NORTHING

Return the latitude and longitude for the given UTM or UPS ZONE, EASTING and NORTHING.

Package

utm-ups

Source

utm-ups.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *ellipsoids*

Ellipsoids used to modelize the earth, defined by an equatorial radius and a squared eccentricity.

Package

utm-ups

Source

utm-ups.lisp (file)


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

5.2.2 Functions

Function: deg->rad ANGLE

Convert ANGLE from radians to degrees.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: ellipsoid-e2 ELLIPSOID

Return the squared eccentricity of an ELLIPSOID.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: ellipsoid-r ELLIPSOID

Return the equatorial radius of an ELLIPSOID.

Package

utm-ups

Source

utm-ups.lisp (file)

Function: rad->deg ANGLE

Convert ANGLE from degrees to radians.

Package

utm-ups

Source

utm-ups.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   U  
Index Entry  Section

F
File, Lisp, utm-ups.asd: The utm-ups․asd file
File, Lisp, utm-ups/utm-ups.lisp: The utm-ups/utm-ups․lisp file

L
Lisp File, utm-ups.asd: The utm-ups․asd file
Lisp File, utm-ups/utm-ups.lisp: The utm-ups/utm-ups․lisp file

U
utm-ups.asd: The utm-ups․asd file
utm-ups/utm-ups.lisp: The utm-ups/utm-ups․lisp file

Jump to:   F   L   U  

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

A.2 Functions

Jump to:   B   D   E   F   L   P   R   U  
Index Entry  Section

B
band: Exported functions

D
deg->rad: Internal functions

E
ellipsoid-e2: Internal functions
ellipsoid-r: Internal functions
ellipsoids: Exported functions

F
format-lat/lon: Exported functions
format-utm/ups: Exported functions
Function, band: Exported functions
Function, deg->rad: Internal functions
Function, ellipsoid-e2: Internal functions
Function, ellipsoid-r: Internal functions
Function, ellipsoids: Exported functions
Function, format-lat/lon: Exported functions
Function, format-utm/ups: Exported functions
Function, lat/lon->ups: Exported functions
Function, lat/lon->utm: Exported functions
Function, lat/lon->utm/ups: Exported functions
Function, parse-lat/lon: Exported functions
Function, parse-utm/ups: Exported functions
Function, rad->deg: Internal functions
Function, ups->lat/lon: Exported functions
Function, ups-band: Exported functions
Function, utm->lat/lon: Exported functions
Function, utm-band: Exported functions
Function, utm-zone: Exported functions
Function, utm/ups->lat/lon: Exported functions

L
lat/lon->ups: Exported functions
lat/lon->utm: Exported functions
lat/lon->utm/ups: Exported functions

P
parse-lat/lon: Exported functions
parse-utm/ups: Exported functions

R
rad->deg: Internal functions

U
ups->lat/lon: Exported functions
ups-band: Exported functions
utm->lat/lon: Exported functions
utm-band: Exported functions
utm-zone: Exported functions
utm/ups->lat/lon: Exported functions

Jump to:   B   D   E   F   L   P   R   U  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*ellipsoid*: Exported special variables
*ellipsoids*: Internal special variables

S
Special Variable, *ellipsoid*: Exported special variables
Special Variable, *ellipsoids*: Internal special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   P   S   U  
Index Entry  Section

P
Package, utm-ups: The utm-ups package

S
System, utm-ups: The utm-ups system

U
utm-ups: The utm-ups system
utm-ups: The utm-ups package

Jump to:   P   S   U