From 593fcc4b57d0f5c3a46134add142ee8d9316aec6 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 11 Feb 2019 22:11:32 +0100 Subject: test/cli/testcct: add minimalistic test of cct --- test/cli/Makefile.am | 9 +++++++-- test/cli/testcct | 51 +++++++++++++++++++++++++++++++++++++++++++++++ test/cli/testcct_out.dist | 3 +++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100755 test/cli/testcct create mode 100644 test/cli/testcct_out.dist (limited to 'test/cli') diff --git a/test/cli/Makefile.am b/test/cli/Makefile.am index 50654968..9a8c7d5e 100644 --- a/test/cli/Makefile.am +++ b/test/cli/Makefile.am @@ -5,6 +5,7 @@ EXEPATH = ../../src PROJEXE = $(EXEPATH)/proj CS2CSEXE = $(EXEPATH)/cs2cs PROJINFOEXE = $(EXEPATH)/projinfo +CCTEXE = $(EXEPATH)/cct # PROJ.4 test scripts TEST27 = $(THIS_DIR)/test27 @@ -15,12 +16,13 @@ TESTFLAKY = $(THIS_DIR)/testflaky TESTDATUMFILE = $(THIS_DIR)/testdatumfile TESTIGN = $(THIS_DIR)/testIGNF TESTPROJINFO = $(THIS_DIR)/testprojinfo +TESTCCT = $(THIS_DIR)/testcct EXTRA_DIST = pj_out27.dist pj_out83.dist td_out.dist \ test27 test83 tv_out.dist tf_out.dist \ testflaky testvarious testdatumfile testntv2 ntv2_out.dist \ testIGNF proj_outIGNF.dist \ - testprojinfo testprojinfo_out.dist \ + testprojinfo testprojinfo_out.dist testcct_out.dist \ CMakeLists.txt testprojinfo-check: @@ -50,4 +52,7 @@ testntv2-check: PROJ_LIB=$(DATAPATH) $(TESTNTV2) $(CS2CSEXE) ; \ fi -check-local: testprojinfo-check test27-check test83-check testvarious-check testdatumfile-check testign-check testntv2-check +testcct-check: + PROJ_LIB=$(DATAPATH) $(TESTCCT) $(CCTEXT) + +check-local: testprojinfo-check test27-check test83-check testvarious-check testdatumfile-check testign-check testntv2-check testcct-check diff --git a/test/cli/testcct b/test/cli/testcct new file mode 100755 index 00000000..93749052 --- /dev/null +++ b/test/cli/testcct @@ -0,0 +1,51 @@ +: +# Test cct + +TEST_CLI_DIR=`dirname $0` +DATA_DIR=`dirname $0`/../../data +EXE=$1 + +usage() +{ + echo "Usage: ${0} " + echo + exit 1 +} + +if test -z "${EXE}"; then + EXE=../../src/cct +fi + +if test ! -x ${EXE}; then + echo "*** ERROR: Can not find '${EXE}' program!" + exit 1 +fi + +echo "============================================" +echo "Running ${0} using ${EXE}:" +echo "============================================" + +OUT=testcct_out + +rm -f ${OUT} + +echo "Testing cct -d 8 +proj=merc +R=1" >> ${OUT} +echo "90 45" 0 | $EXE -d 8 +proj=merc +R=1 >>${OUT} +echo "" >>${OUT} + +# do 'diff' with distribution results +echo "diff ${OUT} with testcct_out.dist" +diff -u ${OUT} ${TEST_CLI_DIR}/testcct_out.dist +if [ $? -ne 0 ] ; then + echo "" + echo "PROBLEMS HAVE OCCURRED" + echo "test file ${OUT} saved" + echo + exit 100 +else + echo "TEST OK" + echo "test file ${OUT} removed" + echo + /bin/rm -f ${OUT} + exit 0 +fi diff --git a/test/cli/testcct_out.dist b/test/cli/testcct_out.dist new file mode 100644 index 00000000..44dd6964 --- /dev/null +++ b/test/cli/testcct_out.dist @@ -0,0 +1,3 @@ +Testing cct -d 8 +proj=merc +R=1 + 1.57079633 0.88137359 0.00000000 inf + -- cgit v1.2.3 From 5141b3908e59a26c9fe66de94bb7388bff741b58 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 11 Feb 2019 23:58:16 +0100 Subject: Make tmerc an alias for etmerc. (#1234) * Make tmerc an alias for etmerc This switches the algorithm used in tmerc to the Poder/Engsager tmerc algorithm. The original tmerc algorithm of Evenden/Snyder origin can still be accessed by adding the +approx flag when initializing a tmerc projection. The +approx flag can also be used when initializing UTM projections, in which case the Evenden/Snyder algorithm is used as well. If a tmerc projection is instantiated on a spherical earth the Evenden/Snyder algorithm is used as well since the Poder/Engsager algorithm is only defined on the ellipsoid. +proj=etmerc can still be instantiated for backwards compatibility reasons. Co-authored-by: Kristian Evers Co-authored-by: Even Rouault --- test/cli/testvarious | 4 ++-- test/cli/tv_out.dist | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test/cli') diff --git a/test/cli/testvarious b/test/cli/testvarious index 7ec50bb3..c1fa61df 100755 --- a/test/cli/testvarious +++ b/test/cli/testvarious @@ -239,7 +239,7 @@ EOF echo "##############################################################" >> ${OUT} echo "Test transverse mercator (#97)" >> ${OUT} # -$EXE +proj=tmerc +k=0.998 +lon_0=-20 +datum=WGS84 +x_0=10000 +y_0=20000 \ +$EXE +proj=tmerc +approx +k=0.998 +lon_0=-20 +datum=WGS84 +x_0=10000 +y_0=20000 \ +to +proj=latlong +datum=WGS84 \ -E >>${OUT} <> ${OUT} echo "Test transverse mercator inverse (#97)" >> ${OUT} # $EXE +proj=latlong +datum=WGS84 \ - +to +proj=tmerc +k=0.998 +lon_0=-20 +datum=WGS84 +x_0=10000 +y_0=20000 \ + +to +proj=tmerc +approx +k=0.998 +lon_0=-20 +datum=WGS84 +x_0=10000 +y_0=20000 \ -E >>${OUT} < Date: Tue, 12 Feb 2019 09:37:20 +0100 Subject: Fix build failure --- test/cli/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/cli') diff --git a/test/cli/Makefile.am b/test/cli/Makefile.am index 9a8c7d5e..46359807 100644 --- a/test/cli/Makefile.am +++ b/test/cli/Makefile.am @@ -22,7 +22,8 @@ EXTRA_DIST = pj_out27.dist pj_out83.dist td_out.dist \ test27 test83 tv_out.dist tf_out.dist \ testflaky testvarious testdatumfile testntv2 ntv2_out.dist \ testIGNF proj_outIGNF.dist \ - testprojinfo testprojinfo_out.dist testcct_out.dist \ + testprojinfo testprojinfo_out.dist \ + testcct testcct_out.dist \ CMakeLists.txt testprojinfo-check: -- cgit v1.2.3 From 94f0d87714a86385a0102f1cbd086f888475912f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 12 Feb 2019 09:47:29 +0100 Subject: Fix typo --- test/cli/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/cli') diff --git a/test/cli/Makefile.am b/test/cli/Makefile.am index 46359807..c0bc0871 100644 --- a/test/cli/Makefile.am +++ b/test/cli/Makefile.am @@ -54,6 +54,6 @@ testntv2-check: fi testcct-check: - PROJ_LIB=$(DATAPATH) $(TESTCCT) $(CCTEXT) + PROJ_LIB=$(DATAPATH) $(TESTCCT) $(CCTEXE) check-local: testprojinfo-check test27-check test83-check testvarious-check testdatumfile-check testign-check testntv2-check testcct-check -- cgit v1.2.3 From a0e51031d922a9d273a8bba46c6039f7c6caa816 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 12 Feb 2019 10:14:35 +0100 Subject: Add testprojinfo and testcct to CMake setup --- test/cli/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/cli') diff --git a/test/cli/CMakeLists.txt b/test/cli/CMakeLists.txt index d197b2aa..0c4ccf1b 100644 --- a/test/cli/CMakeLists.txt +++ b/test/cli/CMakeLists.txt @@ -3,10 +3,13 @@ # set(CS2CS_BIN "cs2cs") set(PROJ_BIN "proj") +set(PROJINFO_BIN "projinfo") +set(CCT_BIN "cct") proj_add_test_script_sh("test27" PROJ_BIN ) proj_add_test_script_sh("test83" PROJ_BIN ) proj_add_test_script_sh("testvarious" CS2CS_BIN ) proj_add_test_script_sh("testdatumfile" CS2CS_BIN "connu") proj_add_test_script_sh("testIGNF" CS2CS_BIN "ntf_r93.gsb") proj_add_test_script_sh("testntv2" CS2CS_BIN "ntv2_0.gsb") - +proj_add_test_script_sh("testprojinfo" PROJINFO_BIN ) +proj_add_test_script_sh("testcct" CCT_BIN ) -- cgit v1.2.3