Ditch GeoJSON user-point indentation
[phoros.git] / test.lisp
blob356bd9e01ac9a6db70367b32e2f888c9ac28e906
1 (defpackage phoros-test
2 (:use :common-lisp
3 :rt))
5 (in-package :phoros-test)
7 (defun round-numbers (decimal-digits numbers)
8 (let ((format-string (format nil "~~{~~,~DF~~#^ ~~}" decimal-digits)))
9 (format nil format-string numbers)))
11 (deftest cs2cs/1
12 (round-numbers
13 8 (proj:cs2cs (list (proj:degrees-to-radians -112.5d0)
14 (proj:degrees-to-radians +45.25919444444d0)
15 100d0)
16 :source-cs "+proj=latlong +datum=NAD83"
17 :destination-cs "+proj=utm +zone=10 +datum=NAD27"))
18 "1323852.82619611 5065462.32041128 99.99994720")
20 (deftest geographic-to-utm/1
21 (round-numbers
22 8 (phoros::geographic-to-utm 31 13d0 50d0 200d0))
23 "1216025.31786614 5586720.84493467 200.00000000")
25 (deftest geographic-to-utm/2
26 (round-numbers
27 8 (phoros::geographic-to-utm 32 13d0 50d0 200d0))
28 "786627.95104280 5546300.84739345 200.00000000")
30 (deftest geographic-to-utm/3
31 (round-numbers
32 8 (phoros::geographic-to-utm 32 13 50 200))
33 "786627.95104280 5546300.84739345 200.00000000")
35 (deftest assert-utm-zone/1
36 (phoros::assert-utm-zone
37 9.427261747452828 3 9.28838684 53.19274138 68.969 519267.427 5893750.59 68.969)
38 nil)
40 (deftest assert-utm-zone/2
41 (handler-case
42 (phoros::assert-utm-zone
43 9.427261747452828 3 9.28838684 53.19274138 68.969 519267.627 5893750.59 68.969)
44 (simple-error () "expected error"))
45 "expected error")