-
Notifications
You must be signed in to change notification settings - Fork 802
/
Copy pathtestproj
executable file
·76 lines (68 loc) · 1.55 KB
/
testproj
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
:
# Script to test proj exe
#
TEST_CLI_DIR=`dirname $0`
EXE=$1
usage()
{
echo "Usage: ${0} <path to 'proj' program>"
echo
exit 1
}
if test -z "${EXE}"; then
EXE=../../src/proj
fi
if test ! -x ${EXE}; then
echo "*** ERROR: Can not find '${EXE}' program!"
exit 1
fi
if test -z "${PROJ_DATA}"; then
export PROJ_DATA="`dirname $0`/../../data"
fi
echo "============================================"
echo "Running ${0} using ${EXE}:"
echo "============================================"
OUT=testproj_out
#
echo "doing tests into file ${OUT}, please wait"
#
$EXE +ellps=WGS84 +proj=ob_tran +o_proj=latlon +o_lon_p=0.0 +o_lat_p=90.0 +lon_0=360.0 +to_meter=0.0174532925199433 +no_defs -E -f '%.3f' >${OUT} <<EOF
2 49
EOF
#
echo "Test CRS option"
#
$EXE EPSG:32620 -S >>${OUT} <<EOF
-63 0
EOF
echo "Test projection factors on projected CRS with non-Greenwhich prime meridian"
#
$EXE EPSG:27571 -S >>${OUT} <<EOF
2.33722917 49.5
EOF
echo "Test projection factors on compound CRS with a projected CRS"
#
$EXE EPSG:5972 -S >>${OUT} <<EOF
9 0
EOF
# On some architectures the angular distortion (omega) of EPSG:27571 is
# not exactly 0, but 8.53878e-07
cat ${OUT} | sed "s/8.53878e-07/0/" > ${OUT}.tmp
mv ${OUT}.tmp ${OUT}
#
# do 'diff' with distribution results
echo "diff ${OUT} with testproj_out.dist"
diff -u -b ${OUT} ${TEST_CLI_DIR}/testproj_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