diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2009-05-19 15:01:27 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2009-05-19 15:01:27 +0000 |
| commit | 9de8a9bb05573efcb9b9776b15b40380a9bd7fd0 (patch) | |
| tree | 86c52abf6d6e62eec27b79924966f9673f8dc961 | |
| parent | 3a60273d399ae05c479c4b0c45d5c718c70bb135 (diff) | |
| download | PROJ-9de8a9bb05573efcb9b9776b15b40380a9bd7fd0.tar.gz PROJ-9de8a9bb05573efcb9b9776b15b40380a9bd7fd0.zip | |
split datum and non-datum tests, add kav5 test (#40)
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1579 4e78687f-474d-0410-85f9-8d5e500ac6b2
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | nad/Makefile.am | 8 | ||||
| -rw-r--r-- | nad/Makefile.in | 7 | ||||
| -rw-r--r-- | nad/td_out.dist | 37 | ||||
| -rwxr-xr-x | nad/testdatumfile | 89 | ||||
| -rwxr-xr-x | nad/testvarious | 56 | ||||
| -rw-r--r-- | nad/tv_out.dist | 41 |
7 files changed, 161 insertions, 82 deletions
@@ -1,3 +1,8 @@ +2009-05-19 Frank Warmerdam <warmerdam@pobox.com> + + * nad/testvarious,nad/testdatumfile: split datum file specific + stuff into testdatumfile, and add kav5 test in testvarious (#40). + 2009-05-18 Frank Warmerdam <warmerdam@pobox.com> * src/PJ_sts.c: Remove duplicate division o lp.phi by P->C_p (#40). diff --git a/nad/Makefile.am b/nad/Makefile.am index 5d54b136..98575381 100644 --- a/nad/Makefile.am +++ b/nad/Makefile.am @@ -8,6 +8,7 @@ TEST27 = ./test27 TEST83 = ./test83 TESTNTV2 = ./testntv2 TESTVARIOUS = ./testvarious +TESTDATUMFILE = ./testdatumfile TESTIGN = ./testIGNF pkgdata_DATA = GL27 nad.lst nad27 nad83 proj_def.dat world epsg esri \ @@ -15,8 +16,8 @@ pkgdata_DATA = GL27 nad.lst nad27 nad83 proj_def.dat world epsg esri \ IGNF EXTRA_DIST = GL27 nad.lst nad27 nad83 pj_out27.dist pj_out83.dist td_out.dist \ - proj_def.dat test27 test83 world epsg esri \ - testvarious testntv2 ntv2_out.dist \ + proj_def.dat test27 test83 world epsg esri tv_out.dist \ + testvarious testdatumfile testntv2 ntv2_out.dist \ esri.extra other.extra \ IGNF testIGNF proj_outIGNF.dist \ makefile.vc @@ -55,9 +56,10 @@ install-data-local: process-nad2bin check-local: process-nad2bin $(TEST27) $(PROJEXE) $(TEST83) $(PROJEXE) + $(TESTVARIOUS) $(CS2CSEXE) ; \ @if [ -f conus ] ; then \ export PROJ_LIB=. ; \ - $(TESTVARIOUS) $(CS2CSEXE) ; \ + $(TESTDATUMFILE) $(CS2CSEXE) ; \ fi # $(TESTNTV2) $(CS2CSEXE) diff --git a/nad/Makefile.in b/nad/Makefile.in index ead0b83e..66eaf560 100644 --- a/nad/Makefile.in +++ b/nad/Makefile.in @@ -171,15 +171,15 @@ CS2CSEXE = $(EXEPATH)/cs2cs TEST27 = ./test27 TEST83 = ./test83 TESTNTV2 = ./testntv2 -TESTVARIOUS = ./testvarious +TESTVARIOUS = ./testdatumfile TESTIGN = ./testIGNF pkgdata_DATA = GL27 nad.lst nad27 nad83 proj_def.dat world epsg esri \ esri.extra other.extra \ IGNF EXTRA_DIST = GL27 nad.lst nad27 nad83 pj_out27.dist pj_out83.dist td_out.dist \ - proj_def.dat test27 test83 world epsg esri \ - testvarious testntv2 ntv2_out.dist \ + proj_def.dat test27 test83 world epsg esri tv_out.dist \ + testvarious testdatumfile testntv2 ntv2_out.dist \ esri.extra other.extra \ IGNF testIGNF proj_outIGNF.dist \ makefile.vc @@ -408,6 +408,7 @@ install-data-local: process-nad2bin check-local: process-nad2bin $(TEST27) $(PROJEXE) $(TEST83) $(PROJEXE) + $(TESTVARIOUS) $(CS2CSEXE) ; \ @if [ -f conus ] ; then \ export PROJ_LIB=. ; \ $(TESTVARIOUS) $(CS2CSEXE) ; \ diff --git a/nad/td_out.dist b/nad/td_out.dist index 0cc39cd9..540d523e 100644 --- a/nad/td_out.dist +++ b/nad/td_out.dist @@ -12,40 +12,3 @@ Test MD used where available 79d58'00.000"W 36d58'00.000"N 0.0 79d57'59.128"W 36d58'0.501"N 0.000 79d58'00.000"W 37d02'00.000"N 0.0 79d57'59.126"W 37d2'0.501"N 0.000 79d58'00.000"W 36d58'00.000"N 0.0 79d57'59.128"W 36d58'0.501"N 0.000 -############################################################## -Test raw ellipse to raw ellipse -79d58'00.000"W 37d02'00.000"N 0.0 79d58'W 37d2'N 0.000 -79d58'00.000"W 36d58'00.000"N 0.0 79d58'W 36d58'N 0.000 -############################################################## -Test NAD27 to raw ellipse -79d00'00.000"W 35d00'00.000"N 0.0 79dW 35dN 0.000 -############################################################## -Between two 3parameter approximations on same ellipsoid -0d00'00.000"W 0d00'00.000"N 0.0 0dE 0dN 4.000 -79d00'00.000"W 45d00'00.000"N 0.0 78d59'59.821"W 44d59'59.983"N 0.540 -############################################################## -3param to raw ellipsoid on same ellipsoid -0d00'00.000"W 0d00'00.000"N 0.0 0dE 0dN 0.000 -79d00'00.000"W 45d00'00.000"N 0.0 79dW 45dN 0.000 -############################################################## -Test simple prime meridian handling. -0d00'00.000"W 0d00'00.000"N 0.0 1dW 0dN 0.000 -79d00'00.000"W 45d00'00.000"N 0.0 80dW 45dN 0.000 -############################################################## -Test simple prime meridian handling within a projection. -500000 3000000 113dW 27d7'20.891"N 0.000 -############################################################## -Test geocentric x/y/z generation. -0d00'00.000"W 0d00'00.000"N 0.0 6378137.00 -0.00 0.00 -0d00'00.000"W 0d00'00.000"N 10.0 6378147.00 -0.00 0.00 -79d00'00.000"W 45d00'00.000"N 0.0 861996.98 -4434590.01 4487348.41 -0d00'00.000"W 90d00'00.000"N 0.0 0.00 -0.00 6356752.31 -############################################################## -Test geocentric x/y/z consumption. -6378137.00 -0.00 0.00 0dE 0dN 0.000 -6378147.00 -0.00 0.00 0dE 0dN 10.000 -861996.98 -4434590.01 4487348.41 79dW 45dN 0.001 -0.00 -0.00 6356752.31 0dE 90dN -0.004 -############################################################## -Test stere projection (re: win32 ticket 12) -105 40 5577808.93 1494569.40 0.00 diff --git a/nad/testdatumfile b/nad/testdatumfile new file mode 100755 index 00000000..4a647ef3 --- /dev/null +++ b/nad/testdatumfile @@ -0,0 +1,89 @@ +: +# Script to do some testing of various transformations depending on datum +# files that are not always available. +# +# +EXE=$1 + +usage() +{ + echo "Usage: ${0} <path to 'cs2cs' program>" + echo + exit 1 +} + +if test -z "${EXE}"; then + echo "*** ERROR: Missing path to 'cs2cs' program." + usage +else + if test ! -x ${EXE}; then + echo "*** ERROR: Can not find '${EXE}' program!" + exit 1 + fi +fi + +echo "============================================" +echo "Running ${0} using ${EXE}:" +echo "============================================" + +OUT=td_out +#EXE=../src/cs2cs +# +echo "doing tests into file ${OUT}, please wait" +rm -f ${OUT} +# +echo "##############################################################" >> ${OUT} +echo 1st through ntv1, 2nd through conus >> ${OUT} +# +$EXE +proj=latlong +ellps=clrk66 +nadgrids=ntv1_can.dat,conus \ + +to +proj=latlong +datum=NAD83 \ + -E >>${OUT} <<EOF +111d00'00.000"W 44d00'00.000"N 0.0 +111d00'00.000"W 39d00'00.000"N 0.0 +EOF + +echo "##############################################################" >> ${OUT} +echo As above, but without ntv1 everything goes through conus file. >> ${OUT} +# +$EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \ + +to +proj=latlong +datum=NAD83 \ + -E >>${OUT} <<EOF +111d00'00.000"W 44d00'00.000"N 0.0 +111d00'00.000"W 39d00'00.000"N 0.0 +EOF + +echo "##############################################################" >> ${OUT} +echo Test MD used where available >> ${OUT} +# +$EXE +proj=latlong +ellps=clrk66 +nadgrids=MD,conus \ + +to +proj=latlong +datum=NAD83 \ + -E >>${OUT} <<EOF +79d58'00.000"W 37d02'00.000"N 0.0 +79d58'00.000"W 36d58'00.000"N 0.0 +EOF +# +$EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \ + +to +proj=latlong +datum=NAD83 \ + -E >>${OUT} <<EOF +79d58'00.000"W 37d02'00.000"N 0.0 +79d58'00.000"W 36d58'00.000"N 0.0 +EOF +# +############################################################################## +# Done! +# do 'diff' with distribution results +echo "diff ${OUT} with ${OUT}.dist" +diff -b ${OUT} ${OUT}.dist +if [ $? -ne 0 ] ; then + echo "" + echo "PROBLEMS HAVE OCCURED" + 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 diff --git a/nad/testvarious b/nad/testvarious index b09526f9..e329778b 100755 --- a/nad/testvarious +++ b/nad/testvarious @@ -1,5 +1,6 @@ : -# Script to do some testing of various transformation. +# Script to do some testing of various transformation that do not depend +# on datum files. # # EXE=$1 @@ -25,50 +26,13 @@ echo "============================================" echo "Running ${0} using ${EXE}:" echo "============================================" -OUT=td_out +OUT=tv_out #EXE=../src/cs2cs # echo "doing tests into file ${OUT}, please wait" rm -f ${OUT} # echo "##############################################################" >> ${OUT} -echo 1st through ntv1, 2nd through conus >> ${OUT} -# -$EXE +proj=latlong +ellps=clrk66 +nadgrids=ntv1_can.dat,conus \ - +to +proj=latlong +datum=NAD83 \ - -E >>${OUT} <<EOF -111d00'00.000"W 44d00'00.000"N 0.0 -111d00'00.000"W 39d00'00.000"N 0.0 -EOF - -echo "##############################################################" >> ${OUT} -echo As above, but without ntv1 everything goes through conus file. >> ${OUT} -# -$EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \ - +to +proj=latlong +datum=NAD83 \ - -E >>${OUT} <<EOF -111d00'00.000"W 44d00'00.000"N 0.0 -111d00'00.000"W 39d00'00.000"N 0.0 -EOF - -echo "##############################################################" >> ${OUT} -echo Test MD used where available >> ${OUT} -# -$EXE +proj=latlong +ellps=clrk66 +nadgrids=MD,conus \ - +to +proj=latlong +datum=NAD83 \ - -E >>${OUT} <<EOF -79d58'00.000"W 37d02'00.000"N 0.0 -79d58'00.000"W 36d58'00.000"N 0.0 -EOF -# -$EXE +proj=latlong +ellps=clrk66 +nadgrids=conus \ - +to +proj=latlong +datum=NAD83 \ - -E >>${OUT} <<EOF -79d58'00.000"W 37d02'00.000"N 0.0 -79d58'00.000"W 36d58'00.000"N 0.0 -EOF -# -echo "##############################################################" >> ${OUT} echo Test raw ellipse to raw ellipse >> ${OUT} # $EXE +proj=latlong +ellps=clrk66 \ @@ -173,6 +137,20 @@ $EXE +proj=latlong +datum=WGS84 \ 105 40 EOF # +echo "##############################################################" >> ${OUT} +echo "Test sts projection (re: ticket 12)" >> ${OUT} +# +$EXE +proj=latlong +ellps=WGS84 \ + +to +proj=kav5 +ellps=WGS84 +units=m \ + -E >>${OUT} <<EOF +4.897000 52.371000 +EOF +$EXE +proj=kav5 +ellps=WGS84 +units=m \ + +to +proj=latlong +ellps=WGS84 \ + -E >>${OUT} <<EOF +383646.088858 5997047.888175 +EOF +# ############################################################################## # Done! # do 'diff' with distribution results diff --git a/nad/tv_out.dist b/nad/tv_out.dist new file mode 100644 index 00000000..cd49b915 --- /dev/null +++ b/nad/tv_out.dist @@ -0,0 +1,41 @@ +############################################################## +Test raw ellipse to raw ellipse +79d58'00.000"W 37d02'00.000"N 0.0 79d58'W 37d2'N 0.000 +79d58'00.000"W 36d58'00.000"N 0.0 79d58'W 36d58'N 0.000 +############################################################## +Test NAD27 to raw ellipse +79d00'00.000"W 35d00'00.000"N 0.0 79dW 35dN 0.000 +############################################################## +Between two 3parameter approximations on same ellipsoid +0d00'00.000"W 0d00'00.000"N 0.0 0dE 0dN 4.000 +79d00'00.000"W 45d00'00.000"N 0.0 78d59'59.821"W 44d59'59.983"N 0.540 +############################################################## +3param to raw ellipsoid on same ellipsoid +0d00'00.000"W 0d00'00.000"N 0.0 0dE 0dN 0.000 +79d00'00.000"W 45d00'00.000"N 0.0 79dW 45dN 0.000 +############################################################## +Test simple prime meridian handling. +0d00'00.000"W 0d00'00.000"N 0.0 1dW 0dN 0.000 +79d00'00.000"W 45d00'00.000"N 0.0 80dW 45dN 0.000 +############################################################## +Test simple prime meridian handling within a projection. +500000 3000000 113dW 27d7'20.891"N 0.000 +############################################################## +Test geocentric x/y/z generation. +0d00'00.000"W 0d00'00.000"N 0.0 6378137.00 -0.00 0.00 +0d00'00.000"W 0d00'00.000"N 10.0 6378147.00 -0.00 0.00 +79d00'00.000"W 45d00'00.000"N 0.0 861996.98 -4434590.01 4487348.41 +0d00'00.000"W 90d00'00.000"N 0.0 0.00 -0.00 6356752.31 +############################################################## +Test geocentric x/y/z consumption. +6378137.00 -0.00 0.00 0dE 0dN 0.000 +6378147.00 -0.00 0.00 0dE 0dN 10.000 +861996.98 -4434590.01 4487348.41 79dW 45dN 0.001 +0.00 -0.00 6356752.31 0dE 90dN -0.004 +############################################################## +Test stere projection (re: win32 ticket 12) +105 40 5577808.93 1494569.40 0.00 +############################################################## +Test sts projection (re: ticket 12) +4.897000 52.371000 383646.09 5997047.89 0.00 +383646.088858 5997047.888175 4d53'49.2"E 52d22'15.6"N 0.000 |
