File: testdatumfile

package info (click to toggle)
python-pyproj 1.8.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,772 kB
  • ctags: 2,204
  • sloc: ansic: 10,928; python: 473; makefile: 5
file content (89 lines) | stat: -rwxr-xr-x 2,197 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
:
# Script to do some testing of various transformations depending on datum
# files that are not always available.
#
#
EXE=$1

usage()
{
    echo "Usage: ${0} <path to 'cs2cs' program>" 
    echo
    exit 1
}

if test -z "${EXE}"; then
    echo "*** ERROR: Missing path to 'cs2cs' program."
    usage
else
    if test ! -x ${EXE}; then
        echo "*** ERROR: Can not find '${EXE}' program!"
        exit 1
    fi
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
#
##############################################################################
# Done! 
# do 'diff' with distribution results
echo "diff ${OUT} with ${OUT}.dist"
diff -b ${OUT} ${OUT}.dist
if [ $? -ne 0 ] ; then
	echo  ""
	echo "PROBLEMS HAVE OCCURED"
	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