https://github.com/jl2/utm
Lisp library for converting between latitude/longitude and UTM.
https://github.com/jl2/utm
Last synced: 8 months ago
JSON representation
Lisp library for converting between latitude/longitude and UTM.
- Host: GitHub
- URL: https://github.com/jl2/utm
- Owner: jl2
- License: isc
- Created: 2014-09-05T20:36:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-12-28T01:48:44.000Z (11 months ago)
- Last Synced: 2025-01-24T13:42:55.550Z (10 months ago)
- Language: Common Lisp
- Size: 22.5 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Geospatial - utm - Lisp library for converting between latitude/longitude and UTM. (Lisp)
- awesome-gis - utm - Lisp library for converting between latitude/longitude and UTM. (Geospatial Library / Lisp)
README
This library converts coordinates in latitude/longitude to UTM and from UTM to latitude/longitude.
Here's a sample run showing all off essentially all of the functionality.
```commonlisp
* (ql:quickload 'utm)
To load "utm":
Load 1 ASDF system:
utm
; Loading "utm"
(UTM)
* (utm:lat-lon-to-utm 39.264657358 -105.396267073)
465814.36361674307d0
4346221.50650324d0
13
* (utm:utm-to-lat-lon 465814.36361674307d0 4346221.50650324d0 13)
39.264654456410966d0
-105.39627074290249d0
* (utm:utm-to-lat-lon 422700.0 7605232.0 -53) #| negative zone for southern hemisphere |#
-21.654466375054866d0
134.25293203530634d0
* (utm:lat-lon-to-utm -21.654466375054866d0 134.25293203530634d0)
422700.00003077503d0
7605232.0000484595d0
-53
* (utm:lat-lon-to-utm 39.264657358 -105.396267073 :ellipsoid "WGS72")
465814.3743203891d0
4346220.137838842d0
13
* (utm:utm-to-lat-lon 465814.3743203891d0 4346220.137838842d0 13 :ellipsoid "WGS72")
39.26465442463012d0
-105.39627074272353d0
* (utm:ellipsoid-names)
("NAD83" "WGS84" "GRS80" "WGS72" "Australian1965" "Krasovsky1940"
"International1924" "Hayford1909" "Clake1880" "Clarke1866" "Airy1830"
"Bessel1841" "Everest1830")
*
```
It is based heavily on information from Steve Dutch's [UTM info website](http://www.uwgb.edu/dutchs/FieldMethods/UTMSystem.htm) and [UTM formula website](http://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.htm).
It does not make any attempt to correct for the polar regions, so the results for those areas may be incorrect. To learn why UTM breaks at the polar regions, [see here](http://www.uwgb.edu/dutchs/FieldMethods/UTMSystem.htm).
The calculations seem to be fairly accurate. Converting from lat/lon-> utm -> lat/lon returns the same latitude and longitude within 6 or 7 decimal places, which is probably more accurate than coordinates coming from a regular GPS unit. The results also match up with several online converters, such as [this very good one](http://www.rcn.montana.edu/Resources/Converter.aspx) on the University of Montana's website.