From 9532b482d03b57e26f735dd695257d41fc91cb5f Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Thu, 16 Nov 2017 18:05:54 +0100 Subject: Introduce geodetic-geocentric conversions ... (#669) * Introduce geodetic-geocentric conversions, as PJ_xxx style conversion step and as API entry points * minor improvements and minor bug squashing --- test/gie/more_builtins.gie | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index 1e3ce185..8f57a5f8 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -1,4 +1,3 @@ - =============================================================================== Various test material, mostly converted from selftest entries in PJ_xxx.c @@ -251,14 +250,26 @@ accept 3370658.378 711877.314 5349787.086 2017.0 expect 3370658.18890 711877.42370 5349787.12430 2017.0 accept 3370658.378 711877.314 5349787.086 2018.0 expect 3370658.18087 711877.42750 5349787.12648 2018.0 +------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -builtins +geocentric latitude ------------------------------------------------------------------------------- +operation proj=geoc ellps=GRS80 +accept 12 55 0 0 +expect 12 54.818973308324573 0 0 +roundtrip 1000 +accept 12 90 0 0 +expect 12 90 0 0 +accept 12 -90 0 0 +expect 12 -90 0 0 -END +accept 12 89.99999999999 0 0 +expect 12 89.999999999989996 0 0 +------------------------------------------------------------------------------- +END -- cgit v1.2.3 From 93685def8f4b23d220d04bc658a0ff27e93149e6 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Thu, 16 Nov 2017 18:29:44 +0100 Subject: Reintroduce the gie-internal tests. These were accidentally dropped during PR #669 --- test/gie/more_builtins.gie | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index 8f57a5f8..cf96c77e 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -272,4 +272,13 @@ accept 12 89.99999999999 0 0 expect 12 89.999999999989996 0 0 ------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------- +run the few gie-builtin tests, which are currently either awkward or impossible +to express in the gie command set +------------------------------------------------------------------------------- +builtins +------------------------------------------------------------------------------- + END -- cgit v1.2.3 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 From 742d8913037464b484c45c40c7d14a216599f834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Komsta?= <22728459+luqqe@users.noreply.github.com> Date: Tue, 21 Nov 2017 17:40:21 +0100 Subject: Central conic projection (gnomonic) implementation (as 'proj=ccon') (#662) Central conic projection implemented as 'ccon'. --- test/gie/builtins.gie | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'test') diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index c6a801f8..6b820c01 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -502,6 +502,37 @@ expect -0.001790493 0.000895247 accept -200 -100 expect -0.001790493 -0.000895247 +=============================================================================== +Central Conic + Sph + lat_1 +=============================================================================== + +------------------------------------------------------------------------------- +operation +proj=pipeline +step +proj=ccon +lat_1=52 +lat_0=52 +lon_0=19 +a=6390000 +x_0=330000 +y_0=-350000 +step +proj=axisswap +order=1,-2,3,4 +------------------------------------------------------------------------------- +tolerance 0.00010 mm +accept 24 55 +expect 650031.54109413219363 4106.1617770643609028 +accept 15 49 +expect 37074.189007307473069 676826.23559270039774 +accept 24 49 +expect 696053.36061617843913 672294.56795827199940 +accept 19 52 +expect 330000.00000000000000 350000.00000000000000 + +direction inverse +accept 0 0 +expect 13.840227318521004431 55.030403993648806391 +accept 0 700000 +expect 14.514453594615022781 48.773847834747808675 +accept 700000 0 +expect 24.782707184271129766 55.003515505218481835 +accept 700000 700000 +expect 24.027610763560529927 48.750476070495021286 +accept 330000 350000 +expect 19.000000000000000000 52.000000000000000000 + =============================================================================== Central Cylindrical -- cgit v1.2.3 From d75ca721708dbe8ac55bb3df9ca077848fa5fb63 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Wed, 22 Nov 2017 08:34:16 +0100 Subject: Avoid div-by-0 in to_meter init --- test/gie/more_builtins.gie | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index cf96c77e..8ac8a667 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -273,6 +273,18 @@ expect 12 89.999999999989996 0 0 ------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +some less used options +------------------------------------------------------------------------------- +operation proj=utm ellps=GRS80 zone=32 to_meter=0 +expect failure + +operation proj=utm ellps=GRS80 zone=32 to_meter=10 +accept 12 55 +expect 69187.5632 609890.7825 +------------------------------------------------------------------------------- + + ------------------------------------------------------------------------------- run the few gie-builtin tests, which are currently either awkward or impossible -- cgit v1.2.3 From 55335038504a298a51a0da8cca380cb247695378 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Wed, 22 Nov 2017 09:39:54 +0100 Subject: Avoid div-by-zero in rf setup --- test/gie/ellipsoid.gie | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'test') diff --git a/test/gie/ellipsoid.gie b/test/gie/ellipsoid.gie index 120e407d..63901bc9 100644 --- a/test/gie/ellipsoid.gie +++ b/test/gie/ellipsoid.gie @@ -118,4 +118,37 @@ accept -90 0 expect -1.56904 0 ------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +Shape parameters +------------------------------------------------------------------------------- +operation proj=utm zone=32 ellps=GRS80 rf=0 +expect failure + +operation proj=utm zone=32 ellps=GRS80 es=1 +expect failure + +operation proj=utm zone=32 ellps=GRS80 b=0 +expect failure + +operation proj=utm zone=32 ellps=GRS80 b=6000000 +accept 12 55 +expect 699293.0880 5674591.5295 + +operation proj=utm zone=32 ellps=GRS80 rf=300 +accept 12 55 +expect 691873.1212 6099054.9661 + +operation proj=utm zone=32 ellps=GRS80 f=0.00333333333333 +accept 12 55 +expect 691873.1212 6099054.9661 + +operation proj=utm zone=32 ellps=GRS80 b=6000000 +accept 12 55 +expect 699293.0880 5674591.5295 + +operation proj=utm zone=32 a=6400000 b=6000000 +accept 12 55 +expect 700416.5900 5669475.8884 +------------------------------------------------------------------------------- + END -- cgit v1.2.3 From 1f48f4c333bfe135296d3be643ef4981dc401c38 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Mon, 27 Nov 2017 04:03:07 +0100 Subject: gie support for builtin errcodes, and other improvements (#684) * gie support for builtin errcodes, and other improvements * allow lower case error constants --- test/gie/ellipsoid.gie | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/gie/ellipsoid.gie b/test/gie/ellipsoid.gie index 63901bc9..65101f6c 100644 --- a/test/gie/ellipsoid.gie +++ b/test/gie/ellipsoid.gie @@ -53,13 +53,20 @@ expect 1335833.8895192828 7326837.7148738774 Then try to fail deliberately ------------------------------------------------------------------------------- operation proj=merc ellps=GRS80000000000 -expect failure +expect failure errno unknown_ellp_param operation proj=merc +a=-1 -expect failure +expect failure errno major_axis_not_given operation proj=merc +no_defs -expect failure -operation proj=merc +es=-1 +no_defs -expect failure +expect failure errno major_axis_not_given + +# This one should succeed due to ellps=WGS84 in proj_def.dat +operation proj=merc +accept 0 0 +expect 0 0 + +operation proj=merc +es=-1 +expect failure errno major_axis_not_given + operation expect failure operation cobra @@ -122,13 +129,13 @@ expect -1.56904 0 Shape parameters ------------------------------------------------------------------------------- operation proj=utm zone=32 ellps=GRS80 rf=0 -expect failure +expect failure errno rev_flattening_is_zero operation proj=utm zone=32 ellps=GRS80 es=1 -expect failure +expect failure errno eccentricity_is_one operation proj=utm zone=32 ellps=GRS80 b=0 -expect failure +expect failure errno eccentricity_is_one operation proj=utm zone=32 ellps=GRS80 b=6000000 accept 12 55 -- cgit v1.2.3