~ubuntu-branches/ubuntu/wily/proj/wily

« back to all changes in this revision

Viewing changes to nad/testdatumfile

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2009-10-05 16:28:55 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20091005162855-gnsd4jzn7wtw8uwg
Tags: 4.7.0-1
* New upstream release
* Datum grids files updated to version 1.5.
  (closes: #548297)
* Removed manpages.dpatch, applied upstream.
* Generalized libproj0.install file.
* Policy changed to 3.8.3, without futher changes.
* Minor change to nad2bin.1 man page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
:
 
2
# Script to do some testing of various transformations depending on datum
 
3
# files that are not always available.
 
4
#
 
5
#
 
6
EXE=$1
 
7
 
 
8
usage()
 
9
{
 
10
    echo "Usage: ${0} <path to 'cs2cs' program>" 
 
11
    echo
 
12
    exit 1
 
13
}
 
14
 
 
15
if test -z "${EXE}"; then
 
16
    echo "*** ERROR: Missing path to 'cs2cs' program."
 
17
    usage
 
18
else
 
19
    if test ! -x ${EXE}; then
 
20
        echo "*** ERROR: Can not find '${EXE}' program!"
 
21
        exit 1
 
22
    fi
 
23
fi
 
24
 
 
25
echo "============================================"
 
26
echo "Running ${0} using ${EXE}:"
 
27
echo "============================================"
 
28
 
 
29
OUT=td_out
 
30
#EXE=../src/cs2cs
 
31
#
 
32
echo "doing tests into file ${OUT}, please wait"
 
33
rm -f ${OUT}
 
34
#
 
35
echo "##############################################################" >> ${OUT}
 
36
echo 1st through ntv1, 2nd through conus >> ${OUT}
 
37
#
 
38
$EXE +proj=latlong +ellps=clrk66 +nadgrids=ntv1_can.dat,conus \
 
39
 +to +proj=latlong +datum=NAD83 \
 
40
 -E >>${OUT} <<EOF
 
41
111d00'00.000"W 44d00'00.000"N 0.0
 
42
111d00'00.000"W 39d00'00.000"N 0.0
 
43
EOF
 
44
 
 
45
echo "##############################################################" >> ${OUT}
 
46
echo As above, but without ntv1 everything goes through conus file. >> ${OUT}
 
47
#
 
48
$EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \
 
49
 +to +proj=latlong +datum=NAD83 \
 
50
 -E >>${OUT} <<EOF
 
51
111d00'00.000"W 44d00'00.000"N 0.0
 
52
111d00'00.000"W 39d00'00.000"N 0.0
 
53
EOF
 
54
 
 
55
echo "##############################################################" >> ${OUT}
 
56
echo Test MD used where available >> ${OUT}
 
57
#
 
58
$EXE +proj=latlong +ellps=clrk66 +nadgrids=MD,conus \
 
59
 +to +proj=latlong +datum=NAD83 \
 
60
 -E >>${OUT} <<EOF
 
61
79d58'00.000"W 37d02'00.000"N 0.0
 
62
79d58'00.000"W 36d58'00.000"N 0.0
 
63
EOF
 
64
#
 
65
$EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \
 
66
 +to +proj=latlong +datum=NAD83 \
 
67
 -E >>${OUT} <<EOF
 
68
79d58'00.000"W 37d02'00.000"N 0.0
 
69
79d58'00.000"W 36d58'00.000"N 0.0
 
70
EOF
 
71
#
 
72
##############################################################################
 
73
# Done! 
 
74
# do 'diff' with distribution results
 
75
echo "diff ${OUT} with ${OUT}.dist"
 
76
diff -b ${OUT} ${OUT}.dist
 
77
if [ $? -ne 0 ] ; then
 
78
        echo  ""
 
79
        echo "PROBLEMS HAVE OCCURED"
 
80
        echo "test file ${OUT} saved"
 
81
    echo
 
82
        exit 100
 
83
else
 
84
        echo "TEST OK"
 
85
        echo "test file ${OUT} removed"
 
86
    echo
 
87
        /bin/rm -f ${OUT}
 
88
        exit 0
 
89
fi