| 1 |
: |
| 2 |
# Test geotifcp |
| 3 |
|
| 4 |
TEST_CLI_DIR=`dirname $0` |
| 5 |
DATA_DIR=`dirname $0`/data |
| 6 |
|
| 7 |
EXE=$1 |
| 8 |
LISTGEO_EXE=$2 |
| 9 |
|
| 10 |
usage() |
| 11 |
{ |
| 12 |
echo "Usage: ${0} <path to 'geotifcp' program> <path to 'listgeo' program>" |
| 13 |
echo |
| 14 |
exit 1 |
| 15 |
} |
| 16 |
|
| 17 |
if test -z "${EXE}"; then |
| 18 |
EXE=../bin/geotifcp |
| 19 |
LISTGEO_EXE=../bin/listgeo |
| 20 |
fi |
| 21 |
|
| 22 |
if test ! -x ${EXE}; then |
| 23 |
echo "*** ERROR: Can not find '${EXE}' program!" |
| 24 |
exit 1 |
| 25 |
fi |
| 26 |
|
| 27 |
if test ! -x ${LISTGEO_EXE}; then |
| 28 |
echo "*** ERROR: Can not find '${LISTGEO_EXE}' program!" |
| 29 |
exit 1 |
| 30 |
fi |
| 31 |
|
| 32 |
echo "============================================" |
| 33 |
echo "Running ${0} using ${EXE}:" |
| 34 |
echo "============================================" |
| 35 |
|
| 36 |
|
| 37 |
OUT=testgeotifcp_out |
| 38 |
|
| 39 |
rm -f ${OUT} |
| 40 |
|
| 41 |
$LISTGEO_EXE ${DATA_DIR}/albers_equal_area.tif > tmp_albers_equal_area.txt |
| 42 |
$EXE -g tmp_albers_equal_area.txt ${DATA_DIR}/byte.tif tmp_albers_equal_area.tif |
| 43 |
$LISTGEO_EXE tmp_albers_equal_area.tif >> ${OUT} |
| 44 |
rm -f tmp_albers_equal_area.txt |
| 45 |
rm -f tmp_albers_equal_area.tif |
| 46 |
echo "" >> ${OUT} |
| 47 |
|
| 48 |
$LISTGEO_EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_3083_albers_equal_area.tif > tmp_ProjectedCSTypeGeoKey_3083_albers_equal_area.txt |
| 49 |
$EXE -g tmp_ProjectedCSTypeGeoKey_3083_albers_equal_area.txt ${DATA_DIR}/byte.tif tmp_ProjectedCSTypeGeoKey_3083_albers_equal_area.tif |
| 50 |
$LISTGEO_EXE tmp_ProjectedCSTypeGeoKey_3083_albers_equal_area.tif >> ${OUT} |
| 51 |
rm -f tmp_ProjectedCSTypeGeoKey_3083_albers_equal_area.txt |
| 52 |
rm -f tmp_ProjectedCSTypeGeoKey_3083_albers_equal_area.tif |
| 53 |
echo "" >> ${OUT} |
| 54 |
|
| 55 |
# Test copying a GeoTIFF v1.1 file |
| 56 |
$LISTGEO_EXE ${DATA_DIR}/byte_v11.tif > tmp_byte_v11.txt |
| 57 |
$EXE -g tmp_byte_v11.txt ${DATA_DIR}/byte.tif tmp_byte_v11.tif |
| 58 |
$LISTGEO_EXE tmp_byte_v11.tif >> ${OUT} |
| 59 |
rm -f tmp_byte_v11.txt |
| 60 |
rm -f tmp_byte_v11.tif |
| 61 |
echo "" >> ${OUT} |
| 62 |
|
| 63 |
# Test changing the version number |
| 64 |
$EXE -v 1:1:1 ${DATA_DIR}/byte.tif tmp_byte_v11.tif |
| 65 |
$LISTGEO_EXE tmp_byte_v11.tif >> ${OUT} |
| 66 |
rm -f tmp_byte_v11.tif |
| 67 |
echo "" >> ${OUT} |
| 68 |
|
| 69 |
# do 'diff' with distribution results |
| 70 |
echo "diff ${OUT} with testgeotifcp_out.dist" |
| 71 |
diff -u ${OUT} ${TEST_CLI_DIR}/testgeotifcp_out.dist |
| 72 |
if [ $? -ne 0 ] ; then |
| 73 |
echo "" |
| 74 |
echo "PROBLEMS HAVE OCCURRED" |
| 75 |
echo "test file ${OUT} saved" |
| 76 |
echo |
| 77 |
exit 100 |
| 78 |
else |
| 79 |
echo "TEST OK" |
| 80 |
echo "test file ${OUT} removed" |
| 81 |
echo |
| 82 |
/bin/rm -f ${OUT} |
| 83 |
exit 0 |
| 84 |
fi |