From 5f1522ad7652e562f98328b05d905c407bab99e9 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Mon, 20 Nov 2017 13:20:02 +0100 Subject: 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. --- test/gie/ellipsoid.gie | 121 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 test/gie/ellipsoid.gie (limited to 'test') 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 -- cgit v1.2.3