2 # Script to do some testing of various transformations depending on datum
3 # files that are not always available.
11 echo "Usage: ${0} <path to 'cs2cs' program>"
16 if test -z "${EXE}"; then
20 if test ! -x ${EXE}; then
21 echo "*** ERROR: Can not find '${EXE}' program!"
25 echo "============================================"
26 echo "Running ${0} using ${EXE}:"
27 echo "============================================"
32 echo "doing tests into file ${OUT}, please wait"
35 echo "##############################################################" >> ${OUT}
36 echo 1st through ntv1, 2nd through conus >> ${OUT}
38 $EXE +proj=latlong +ellps=clrk66 +nadgrids=ntv1_can.dat,conus \
39 +to +proj=latlong +datum=NAD83 \
41 111d00'00.000"W 44d00'00.000"N 0.0
42 111d00'00.000"W 39d00'00.000"N 0.0
45 echo "##############################################################" >> ${OUT}
46 echo As above, but without ntv1 everything goes through conus file. >> ${OUT}
48 $EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \
49 +to +proj=latlong +datum=NAD83 \
51 111d00'00.000"W 44d00'00.000"N 0.0
52 111d00'00.000"W 39d00'00.000"N 0.0
55 echo "##############################################################" >> ${OUT}
56 echo Test MD used where available >> ${OUT}
58 $EXE +proj=latlong +ellps=clrk66 +nadgrids=MD,conus \
59 +to +proj=latlong +datum=NAD83 \
61 79d58'00.000"W 37d02'00.000"N 0.0
62 79d58'00.000"W 36d58'00.000"N 0.0
65 $EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \
66 +to +proj=latlong +datum=NAD83 \
68 79d58'00.000"W 37d02'00.000"N 0.0
69 79d58'00.000"W 36d58'00.000"N 0.0
72 echo "##############################################################" >> ${OUT}
73 echo "Test that we use grid shift files even if we are right on the" >> ${OUT}
74 echo "edge or even a wee bit outside (#141)." >> ${OUT}
76 # Our test points are (1) right on mesh corner, (2) outside but within
77 # epsilon (3) inside a bit (4) outside by more than epsilon
79 $EXE +proj=latlong +ellps=WGS84 +nadgrids=ntf_r93.gsb \
80 +to +proj=latlong +datum=WGS84 \
81 -E -f "%.12f" >>${OUT} <<EOF
83 -5.5000000000001 52.0000000000001
88 $EXE +proj=latlong +datum=WGS84 \
89 +to +proj=latlong +ellps=WGS84 +nadgrids=ntf_r93.gsb \
90 -E -f "%.12f" >>${OUT} <<EOF
92 -5.5000000000001 52.0000000000001
97 ##############################################################################
99 # do 'diff' with distribution results
100 echo "diff ${OUT} with ${OUT}.dist"
101 diff -b ${OUT} ${NAD_DIR}/${OUT}.dist
102 if [ $? -ne 0 ] ; then
104 echo "PROBLEMS HAVE OCCURED"
105 echo "test file ${OUT} saved"
110 echo "test file ${OUT} removed"