aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Knudsen <busstoptaktik@users.noreply.github.com>2017-11-20 13:20:02 +0100
committerGitHub <noreply@github.com>2017-11-20 13:20:02 +0100
commit5f1522ad7652e562f98328b05d905c407bab99e9 (patch)
treef8a73c0c5eb53ef4ba05eb5fd0ca5c9f0fa5d882 /test
parent3d6f36a2e10d103727a072d160fcf724daa871d5 (diff)
downloadPROJ-5f1522ad7652e562f98328b05d905c407bab99e9.tar.gz
PROJ-5f1522ad7652e562f98328b05d905c407bab99e9.zip
Replace pj_ell_set with reimplementation... (#675)
* Replace pj_ell_set with reimplementation supporting ellipsoid inheritance * remove unreachable code from pj_ell_set.c * Swap steps, so ellps args are read first, in accordance with historical behaviour * Add ellipsoid tests to CI targets * Reduce some optimistic tolerances OS/X appears to have a slightly off float handling, resulting in differences at the nanometer level. Switching to 10 nm.
Diffstat (limited to 'test')
-rw-r--r--test/gie/ellipsoid.gie121
1 files changed, 121 insertions, 0 deletions
diff --git a/test/gie/ellipsoid.gie b/test/gie/ellipsoid.gie
new file mode 100644
index 00000000..120e407d
--- /dev/null
+++ b/test/gie/ellipsoid.gie
@@ -0,0 +1,121 @@
+===============================================================================
+
+Test pj_ellipsoid, the reimplementation of pj_ell_set
+
+===============================================================================
+
+
+BEGIN
+
+-------------------------------------------------------------------------------
+First a spherical example
+-------------------------------------------------------------------------------
+operation proj=merc R=6400000
+-------------------------------------------------------------------------------
+tolerance 10 nm
+accept 1 2
+expect 111701.0721276371 223447.5262032605
+
+accept 12 55
+expect 1340412.8655316452 7387101.1430967357
+-------------------------------------------------------------------------------
+
+
+-------------------------------------------------------------------------------
+Then an explicitly defined ellipsoidal example
+-------------------------------------------------------------------------------
+operation proj=merc a=6400000 rf=297
+-------------------------------------------------------------------------------
+tolerance 10 nm
+accept 1 2
+expect 111701.0721276371 221945.9681832088
+
+accept 12 55
+expect 1340412.8655316452 7351803.9151705895
+-------------------------------------------------------------------------------
+
+
+-------------------------------------------------------------------------------
+Then try using a built in ellipsoid
+-------------------------------------------------------------------------------
+operation proj=merc ellps=GRS80
+-------------------------------------------------------------------------------
+tolerance 10 nm
+accept 1 2
+expect 111319.4907932736 221194.0771604237
+
+accept 12 55
+expect 1335833.8895192828 7326837.7148738774
+-------------------------------------------------------------------------------
+
+
+-------------------------------------------------------------------------------
+Then try to fail deliberately
+-------------------------------------------------------------------------------
+operation proj=merc ellps=GRS80000000000
+expect failure
+operation proj=merc +a=-1
+expect failure
+operation proj=merc +no_defs
+expect failure
+operation proj=merc +es=-1 +no_defs
+expect failure
+operation
+expect failure
+operation cobra
+expect failure
+-------------------------------------------------------------------------------
+
+
+-------------------------------------------------------------------------------
+Finally test the spherification functionality
+-------------------------------------------------------------------------------
+operation proj=merc ellps=GRS80 R_A
+tolerance 10 nm
+accept 12 55
+expect 1334340.6237297705 7353636.6296552019
+-------------------------------------------------------------------------------
+operation proj=merc ellps=GRS80 R_V
+tolerance 10 nm
+accept 12 55
+expect 1334339.2852675652 7353629.2533042720
+-------------------------------------------------------------------------------
+operation proj=merc ellps=GRS80 R_a
+tolerance 10 nm
+accept 12 55
+expect 1333594.4904527504 7349524.6413825499
+-------------------------------------------------------------------------------
+operation proj=merc ellps=GRS80 R_g
+tolerance 10 nm
+accept 12 55
+expect 1333592.6102291327 7349514.2793497816
+-------------------------------------------------------------------------------
+operation proj=merc ellps=GRS80 R_h
+tolerance 10 nm
+accept 12 55
+expect 1333590.7300081658 7349503.9173316229
+-------------------------------------------------------------------------------
+operation proj=merc ellps=GRS80 R_lat_a=60
+tolerance 10 nm
+accept 12 55
+expect 1338073.7436268919 7374210.0924803326
+-------------------------------------------------------------------------------
+operation proj=merc ellps=GRS80 R_lat_g=60
+tolerance 10 nm
+accept 12 55
+expect 1338073.2696101593 7374207.4801437631
+-------------------------------------------------------------------------------
+
+
+-------------------------------------------------------------------------------
+This one from testvarious failed at first version of the pull request
+-------------------------------------------------------------------------------
+operation proj=healpix a=1 lon_0=0 ellps=WGS84
+-------------------------------------------------------------------------------
+accept 0 41.937853904844985
+expect 0 0.78452
+accept -90 0
+expect -1.56904 0
+-------------------------------------------------------------------------------
+
+END