]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/server/dist/share/proj/testntv2
Adding pkg-precompiled tileserver-mapnik to avoid npm install
[simantics/district.git] / org.simantics.maps.server / server / dist / share / proj / testntv2
1 :
2 #
3 # Test NTv2 (.gsb) support.  Assumes ntv2_0.gsb is installed.
4 #
5 #
6 NAD_DIR=`dirname $0`
7 EXE=$1
8
9 usage()
10 {
11     echo "Usage: ${0} <path to 'cs2cs' program>" 
12     echo
13     exit 1
14 }
15
16 if test -z "${EXE}"; then
17     EXE=../src/cs2cs
18 fi
19
20 if test ! -x ${EXE}; then
21     echo "*** ERROR: Can not find '${EXE}' program!"
22     exit 1
23 fi
24
25 echo "============================================"
26 echo "Running ${0} using ${EXE}:"
27 echo "============================================"
28
29 OUT=ntv2_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 Point in the ONwinsor subgrid. >> ${OUT}
37 #
38 $EXE +proj=latlong +ellps=clrk66 +nadgrids=ntv2_0.gsb \
39  +to +proj=latlong +datum=NAD83 -E -w4 >>${OUT} <<EOF
40 82d00'00.000"W 42d00'00.000"N 0.0
41 82d00'01.000"W 42d00'00.000"N 0.0
42 82d00'02.000"W 42d00'00.000"N 0.0
43 84d00'00.000"W 42d00'00.000"N 0.0
44 EOF
45
46 echo "##############################################################" >> ${OUT}
47 echo Try with NTv2 and NTv1 together ... falls back to NTv1 >> ${OUT}
48 #
49 $EXE +proj=latlong +ellps=clrk66 +nadgrids=ntv2_0.gsb,ntv1_can.dat,conus \
50  +to +proj=latlong +datum=NAD83 -E -w4 >>${OUT} <<EOF
51 99d00'00.000"W 65d00'00.000"N 0.0
52 111d00'00.000"W 46d00'00.000"N 0.0
53 111d00'00.000"W 47d30'00.000"N 0.0
54 EOF
55 #
56 ##############################################################################
57 # Done! 
58 # do 'diff' with distribution results
59 echo "diff ${OUT} with ${OUT}.dist"
60 diff -b ${OUT} ${NAD_DIR}/${OUT}.dist
61 if [ $? -ne 0 ] ; then
62         echo  ""
63         echo "PROBLEMS HAVE OCCURED"
64         echo "test file ${OUT} saved"
65     echo
66     exit 100
67 else
68         echo "TEST OK"
69         echo "test file ${OUT} removed"
70     echo
71         /bin/rm -f ${OUT}
72     exit 0
73 fi
74