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
90
91
92
93
94
95
96
97
98
99
100
|
:
# Test projinfo
TEST_CLI_DIR=`dirname $0`
DATA_DIR=`dirname $0`/../../data
EXE=$1
usage()
{
echo "Usage: ${0} <path to 'projinfo' program>"
echo
exit 1
}
if test -z "${EXE}"; then
EXE=../../src/projinfo
fi
if test ! -x ${EXE}; then
echo "*** ERROR: Can not find '${EXE}' program!"
exit 1
fi
echo "============================================"
echo "Running ${0} using ${EXE}:"
echo "============================================"
OUT=testprojinfo_out
rm -f ${OUT}
echo "Testing projinfo EPSG:4326" >> ${OUT}
$EXE EPSG:4326 >>${OUT}
echo "" >>${OUT}
echo "Testing projinfo -o ALL EPSG:4326" >> ${OUT}
$EXE -o ALL EPSG:4326 >>${OUT}
echo "" >>${OUT}
echo "Testing projinfo -s EPSG:4326 -t EPSG:32631" >> ${OUT}
$EXE -s EPSG:4326 -t EPSG:32631 >>${OUT}
echo "" >>${OUT}
echo "Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary" >> ${OUT}
$EXE -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary >>${OUT}
echo "" >>${OUT}
echo "Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects" >> ${OUT}
$EXE -s NAD27 -t NAD83 --grid-check none --spatial-test intersects >>${OUT}
echo "" >>${OUT}
echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --bbox 8,54.51,15.24,57.8 --summary" >> ${OUT}
$EXE -s EPSG:4230 -t EPSG:4258 --bbox 8,54.51,15.24,57.8 --summary >>${OUT}
echo "" >>${OUT}
echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area EPSG:3237 --summary" >> ${OUT}
$EXE -s EPSG:4230 -t EPSG:4258 --area EPSG:3237 --summary >>${OUT}
echo "" >>${OUT}
echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area 'Denmark - onshore' --summary" >> ${OUT}
$EXE -s EPSG:4230 -t EPSG:4258 --area 'Denmark - onshore' --summary >>${OUT}
echo "" >>${OUT}
# several match
echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area 'Denmark -' --summary" >> ${OUT}
$EXE -s EPSG:4230 -t EPSG:4258 --area 'Denmark -' --summary >>${OUT} 2>&1
echo "" >>${OUT}
echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area no_match --summary" >> ${OUT}
$EXE -s EPSG:4230 -t EPSG:4258 --area no_match --summary >>${OUT} 2>&1
echo "" >>${OUT}
echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area WRONG:CODE --summary" >> ${OUT}
$EXE -s EPSG:4230 -t EPSG:4258 --area WRONG:CODE --summary >>${OUT} 2>&1
echo "" >>${OUT}
echo "Testing deprecated CRS: projinfo EPSG:26591" >> ${OUT}
$EXE EPSG:26591 >>${OUT} 2>&1
echo "" >>${OUT}
echo "Testing non compliant WKT1" >> ${OUT}
$EXE 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],UNIT["degree",0.0174532925199433]]' >>${OUT} 2>&1
echo "" >>${OUT}
# do 'diff' with distribution results
echo "diff ${OUT} with testprojinfo_out.dist"
diff -u ${OUT} ${TEST_CLI_DIR}/testprojinfo_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
|