]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/server/dist/share/proj/testdatumfile
Adding pkg-precompiled tileserver-mapnik to avoid npm install
[simantics/district.git] / org.simantics.maps.server / server / dist / share / proj / testdatumfile
1 :
2 # Script to do some testing of various transformations depending on datum
3 # files that are not always available.
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=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 echo "##############################################################" >> ${OUT}
73 echo "Test that we use grid shift files even if we are right on the" >> ${OUT}
74 echo "edge or even a wee bit outside (#141)."  >> ${OUT}
75 #
76 # Our test points are (1) right on mesh corner, (2) outside but within 
77 # epsilon (3) inside a bit (4) outside by more than epsilon
78 #
79 $EXE +proj=latlong +ellps=WGS84 +nadgrids=ntf_r93.gsb \
80  +to +proj=latlong +datum=WGS84 \
81  -E -f "%.12f" >>${OUT} <<EOF
82 -5.5 52.0
83 -5.5000000000001 52.0000000000001
84 -5.4999 51.9999
85 -5.5001 52.0
86 EOF
87 #
88 $EXE +proj=latlong +datum=WGS84 \
89  +to +proj=latlong +ellps=WGS84 +nadgrids=ntf_r93.gsb \
90  -E -f "%.12f" >>${OUT} <<EOF
91 -5.5 52.0
92 -5.5000000000001 52.0000000000001
93 -5.4999 51.9999
94 -5.5001 52.0
95 EOF
96 #
97 ##############################################################################
98 # Done! 
99 # do 'diff' with distribution results
100 echo "diff ${OUT} with ${OUT}.dist"
101 diff -b ${OUT} ${NAD_DIR}/${OUT}.dist
102 if [ $? -ne 0 ] ; then
103         echo  ""
104         echo "PROBLEMS HAVE OCCURED"
105         echo "test file ${OUT} saved"
106     echo
107         exit 100
108 else
109         echo "TEST OK"
110         echo "test file ${OUT} removed"
111     echo
112         /bin/rm -f ${OUT}
113         exit 0
114 fi