diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-12-01 17:57:32 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-12-01 19:15:48 +0100 |
| commit | 23bf8bf5977073a91353f992ee0dd608be1d45fe (patch) | |
| tree | 9edeb910327228950ea1cbafaf3eb10e4b172edd /test/cli/testdatumfile | |
| parent | 18dbc00dc30db7ca5fa7bd6a00115628324dcd0c (diff) | |
| download | PROJ-23bf8bf5977073a91353f992ee0dd608be1d45fe.tar.gz PROJ-23bf8bf5977073a91353f992ee0dd608be1d45fe.zip | |
Rename test/old/ to test/cli/ to better reflect their nature
Diffstat (limited to 'test/cli/testdatumfile')
| -rwxr-xr-x | test/cli/testdatumfile | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/test/cli/testdatumfile b/test/cli/testdatumfile new file mode 100755 index 00000000..55900427 --- /dev/null +++ b/test/cli/testdatumfile @@ -0,0 +1,115 @@ +: +# Script to do some testing of various transformations depending on datum +# files that are not always available. +# +# +TEST_CLI_DIR=`dirname $0` +DATA_DIR=`dirname $0`/../../data +EXE=$1 + +usage() +{ + echo "Usage: ${0} <path to 'cs2cs' program>" + echo + exit 1 +} + +if test -z "${EXE}"; then + EXE=../../src/cs2cs +fi + +if test ! -x ${EXE}; then + echo "*** ERROR: Can not find '${EXE}' program!" + exit 1 +fi + +echo "============================================" +echo "Running ${0} using ${EXE}:" +echo "============================================" + +OUT=td_out +#EXE=../src/cs2cs +# +echo "doing tests into file ${OUT}, please wait" +rm -f ${OUT} +# +echo "##############################################################" >> ${OUT} +echo 1st through ntv1, 2nd through conus >> ${OUT} +# +$EXE +proj=latlong +ellps=clrk66 +nadgrids=ntv1_can.dat,conus \ + +to +proj=latlong +datum=NAD83 \ + -E >>${OUT} <<EOF +111d00'00.000"W 44d00'00.000"N 0.0 +111d00'00.000"W 39d00'00.000"N 0.0 +EOF + +echo "##############################################################" >> ${OUT} +echo As above, but without ntv1 everything goes through conus file. >> ${OUT} +# +$EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \ + +to +proj=latlong +datum=NAD83 \ + -E >>${OUT} <<EOF +111d00'00.000"W 44d00'00.000"N 0.0 +111d00'00.000"W 39d00'00.000"N 0.0 +EOF + +echo "##############################################################" >> ${OUT} +echo Test MD used where available >> ${OUT} +# +$EXE +proj=latlong +ellps=clrk66 +nadgrids=MD,conus \ + +to +proj=latlong +datum=NAD83 \ + -E >>${OUT} <<EOF +79d58'00.000"W 37d02'00.000"N 0.0 +79d58'00.000"W 36d58'00.000"N 0.0 +EOF +# +$EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \ + +to +proj=latlong +datum=NAD83 \ + -E >>${OUT} <<EOF +79d58'00.000"W 37d02'00.000"N 0.0 +79d58'00.000"W 36d58'00.000"N 0.0 +EOF +# +echo "##############################################################" >> ${OUT} +echo "Test that we use grid shift files even if we are right on the" >> ${OUT} +echo "edge or even a wee bit outside (#141)." >> ${OUT} +# +# Our test points are (1) right on mesh corner, (2) outside but within +# epsilon (3) inside a bit (4) outside by more than epsilon +# +$EXE +proj=latlong +ellps=WGS84 +nadgrids=ntf_r93.gsb,null \ + +to +proj=latlong +datum=WGS84 \ + -E -f "%.12f" >>${OUT} <<EOF +-5.5 52.0 +-5.5000000000001 52.0000000000001 +-5.4999 51.9999 +-5.5001 52.0 +EOF +# +$EXE +proj=latlong +datum=WGS84 \ + +to +proj=latlong +ellps=WGS84 +nadgrids=ntf_r93.gsb,null \ + -E -f "%.12f" >>${OUT} <<EOF +-5.5 52.0 +-5.5000000000001 52.0000000000001 +-5.4999 51.9999 +-5.5001 52.0 +EOF +# +############################################################################## +# Done! +# do 'diff' with distribution results +echo "diff ${OUT} with ${OUT}.dist" +diff -b ${OUT} ${TEST_CLI_DIR}/${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 |
