| 1 |
: |
| 2 |
# Test listgeo |
| 3 |
|
| 4 |
TEST_CLI_DIR=`dirname $0` |
| 5 |
DATA_DIR=`dirname $0`/data |
| 6 |
|
| 7 |
EXE=$1 |
| 8 |
|
| 9 |
usage() |
| 10 |
{ |
| 11 |
echo "Usage: ${0} <path to 'listgeo' program>" |
| 12 |
echo |
| 13 |
exit 1 |
| 14 |
} |
| 15 |
|
| 16 |
if test -z "${EXE}"; then |
| 17 |
EXE=../bin/listgeo |
| 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=testlistgeo_out |
| 30 |
|
| 31 |
rm -f ${OUT} |
| 32 |
|
| 33 |
echo "Testing listgeo byte.tif" >> ${OUT} |
| 34 |
$EXE ${DATA_DIR}/byte.tif >>${OUT} |
| 35 |
echo "" >>${OUT} |
| 36 |
|
| 37 |
echo "Testing listgeo byte_v11.tif" >> ${OUT} |
| 38 |
$EXE ${DATA_DIR}/byte_v11.tif >>${OUT} |
| 39 |
echo "" >>${OUT} |
| 40 |
|
| 41 |
echo "Testing listgeo pcs_32064.tif" >> ${OUT} |
| 42 |
$EXE ${DATA_DIR}/pcs_32064.tif >>${OUT} |
| 43 |
echo "" >>${OUT} |
| 44 |
|
| 45 |
echo "Testing listgeo GeogPrimeMeridianGeoKey.tif" >> ${OUT} |
| 46 |
$EXE ${DATA_DIR}/GeogPrimeMeridianGeoKey.tif >>${OUT} |
| 47 |
echo "" >>${OUT} |
| 48 |
|
| 49 |
echo "Testing listgeo GeogGeodeticDatumGeoKey.tif" >> ${OUT} |
| 50 |
$EXE ${DATA_DIR}/GeogGeodeticDatumGeoKey.tif >>${OUT} |
| 51 |
echo "" >>${OUT} |
| 52 |
|
| 53 |
echo "Testing listgeo GeogAngularUnitsGeoKey_9114.tif" >> ${OUT} |
| 54 |
$EXE ${DATA_DIR}/GeogAngularUnitsGeoKey_9114.tif >>${OUT} |
| 55 |
echo "" >>${OUT} |
| 56 |
|
| 57 |
echo "Testing listgeo ProjLinearUnitsGeoKey_9036.tif" >> ${OUT} |
| 58 |
$EXE ${DATA_DIR}/ProjLinearUnitsGeoKey_9036.tif >>${OUT} |
| 59 |
echo "" >>${OUT} |
| 60 |
|
| 61 |
echo "Testing listgeo ProjectedCSTypeGeoKey_28191_cassini_soldner.tif" >> ${OUT} |
| 62 |
$EXE -no_corners ${DATA_DIR}/ProjectedCSTypeGeoKey_28191_cassini_soldner.tif >>${OUT} |
| 63 |
echo "" >>${OUT} |
| 64 |
|
| 65 |
echo "Testing listgeo cassini_soldner.tif" >> ${OUT} |
| 66 |
$EXE -no_corners ${DATA_DIR}/cassini_soldner.tif >>${OUT} |
| 67 |
echo "" >>${OUT} |
| 68 |
|
| 69 |
echo "Testing listgeo ProjectedCSTypeGeoKey_27200_new_zealand_mapping_grid.tif" >> ${OUT} |
| 70 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_27200_new_zealand_mapping_grid.tif >>${OUT} |
| 71 |
echo "" >>${OUT} |
| 72 |
|
| 73 |
echo "Testing listgeo new_zealand_mapping_grid.tif" >> ${OUT} |
| 74 |
$EXE ${DATA_DIR}/new_zealand_mapping_grid.tif >>${OUT} |
| 75 |
echo "" >>${OUT} |
| 76 |
|
| 77 |
echo "Testing listgeo ProjectedCSTypeGeoKey_29101_polyconic.tif" >> ${OUT} |
| 78 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_29101_polyconic.tif >>${OUT} |
| 79 |
echo "" >>${OUT} |
| 80 |
|
| 81 |
echo "Testing listgeo polyconic.tif" >> ${OUT} |
| 82 |
$EXE ${DATA_DIR}/polyconic.tif >>${OUT} |
| 83 |
echo "" >>${OUT} |
| 84 |
|
| 85 |
echo "Testing listgeo ProjectedCSTypeGeoKey_6808_hotine_oblique_mercator_variant_a.tif" >> ${OUT} |
| 86 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_6808_hotine_oblique_mercator_variant_a.tif >>${OUT} |
| 87 |
echo "" >>${OUT} |
| 88 |
|
| 89 |
echo "Testing listgeo hotine_oblique_mercator_variant_a.tif" >> ${OUT} |
| 90 |
$EXE ${DATA_DIR}/hotine_oblique_mercator_variant_a.tif >>${OUT} |
| 91 |
echo "" >>${OUT} |
| 92 |
|
| 93 |
echo "Testing listgeo ProjectedCSTypeGeoKey_8065_hotine_oblique_mercator_variant_b.tif" >> ${OUT} |
| 94 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_8065_hotine_oblique_mercator_variant_b.tif >>${OUT} |
| 95 |
echo "" >>${OUT} |
| 96 |
|
| 97 |
echo "Testing listgeo hotine_oblique_mercator_variant_b.tif" >> ${OUT} |
| 98 |
$EXE ${DATA_DIR}/hotine_oblique_mercator_variant_b.tif >>${OUT} |
| 99 |
echo "" >>${OUT} |
| 100 |
|
| 101 |
echo "Testing listgeo ProjectedCSTypeGeoKey_8441_oblique_mercator_laborde.tif" >> ${OUT} |
| 102 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_8441_oblique_mercator_laborde.tif >>${OUT} |
| 103 |
echo "" >>${OUT} |
| 104 |
|
| 105 |
echo "Testing listgeo oblique_mercator_laborde.tif" >> ${OUT} |
| 106 |
$EXE ${DATA_DIR}/oblique_mercator_laborde.tif >>${OUT} |
| 107 |
echo "" >>${OUT} |
| 108 |
|
| 109 |
echo "Testing listgeo ProjectedCSTypeGeoKey_5456_lcc1sp.tif" >> ${OUT} |
| 110 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_5456_lcc1sp.tif >>${OUT} |
| 111 |
echo "" >>${OUT} |
| 112 |
|
| 113 |
echo "Testing listgeo lcc1sp.tif" >> ${OUT} |
| 114 |
$EXE ${DATA_DIR}/lcc1sp.tif >>${OUT} |
| 115 |
echo "" >>${OUT} |
| 116 |
|
| 117 |
echo "Testing listgeo ProjectedCSTypeGeoKey_5329_mercator1sp.tif" >> ${OUT} |
| 118 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_5329_mercator1sp.tif >>${OUT} |
| 119 |
echo "" >>${OUT} |
| 120 |
|
| 121 |
echo "Testing listgeo mercator1sp.tif" >> ${OUT} |
| 122 |
$EXE ${DATA_DIR}/mercator1sp.tif >>${OUT} |
| 123 |
echo "" >>${OUT} |
| 124 |
|
| 125 |
echo "Testing listgeo ProjectedCSTypeGeoKey_5641_mercator2sp.tif" >> ${OUT} |
| 126 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_5641_mercator2sp.tif >>${OUT} |
| 127 |
echo "" >>${OUT} |
| 128 |
|
| 129 |
echo "Testing listgeo mercator2sp.tif" >> ${OUT} |
| 130 |
$EXE ${DATA_DIR}/mercator2sp.tif >>${OUT} |
| 131 |
echo "" >>${OUT} |
| 132 |
|
| 133 |
echo "Testing listgeo ProjectedCSTypeGeoKey_5588_oblique_stereographic.tif" >> ${OUT} |
| 134 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_5588_oblique_stereographic.tif >>${OUT} |
| 135 |
echo "" >>${OUT} |
| 136 |
|
| 137 |
echo "Testing listgeo oblique_stereographic.tif" >> ${OUT} |
| 138 |
$EXE ${DATA_DIR}/oblique_stereographic.tif >>${OUT} |
| 139 |
echo "" >>${OUT} |
| 140 |
|
| 141 |
echo "Testing listgeo ProjectedCSTypeGeoKey_5482_polar_stereographic_variant_a.tif" >> ${OUT} |
| 142 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_5482_polar_stereographic_variant_a.tif >>${OUT} |
| 143 |
echo "" >>${OUT} |
| 144 |
|
| 145 |
echo "Testing listgeo polar_stereographic_variant_a.tif" >> ${OUT} |
| 146 |
$EXE ${DATA_DIR}/polar_stereographic_variant_a.tif >>${OUT} |
| 147 |
echo "" >>${OUT} |
| 148 |
|
| 149 |
echo "Testing listgeo ProjectedCSTypeGeoKey_3032_polar_stereographic_variant_b.tif" >> ${OUT} |
| 150 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_3032_polar_stereographic_variant_b.tif >>${OUT} |
| 151 |
echo "" >>${OUT} |
| 152 |
|
| 153 |
echo "Testing listgeo polar_stereographic_variant_b.tif" >> ${OUT} |
| 154 |
$EXE ${DATA_DIR}/polar_stereographic_variant_b.tif >>${OUT} |
| 155 |
echo "" >>${OUT} |
| 156 |
|
| 157 |
echo "Testing listgeo ProjectedCSTypeGeoKey_3814_transverse_mercator.tif" >> ${OUT} |
| 158 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_3814_transverse_mercator.tif >>${OUT} |
| 159 |
echo "" >>${OUT} |
| 160 |
|
| 161 |
echo "Testing listgeo transverse_mercator.tif" >> ${OUT} |
| 162 |
$EXE ${DATA_DIR}/transverse_mercator.tif >>${OUT} |
| 163 |
echo "" >>${OUT} |
| 164 |
|
| 165 |
echo "Testing listgeo ProjectedCSTypeGeoKey_2046_transverse_mercator_south_oriented.tif" >> ${OUT} |
| 166 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_2046_transverse_mercator_south_oriented.tif >>${OUT} |
| 167 |
echo "" >>${OUT} |
| 168 |
|
| 169 |
echo "Testing listgeo transverse_mercator_south_oriented.tif" >> ${OUT} |
| 170 |
$EXE ${DATA_DIR}/transverse_mercator_south_oriented.tif >>${OUT} |
| 171 |
echo "" >>${OUT} |
| 172 |
|
| 173 |
echo "Testing listgeo ProjectedCSTypeGeoKey_3812_lcc2sp.tif" >> ${OUT} |
| 174 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_3812_lcc2sp.tif >>${OUT} |
| 175 |
echo "" >>${OUT} |
| 176 |
|
| 177 |
echo "Testing listgeo lcc2sp.tif" >> ${OUT} |
| 178 |
$EXE ${DATA_DIR}/lcc2sp.tif >>${OUT} |
| 179 |
echo "" >>${OUT} |
| 180 |
|
| 181 |
echo "Testing listgeo ProjectedCSTypeGeoKey_3083_albers_equal_area.tif" >> ${OUT} |
| 182 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_3083_albers_equal_area.tif >>${OUT} |
| 183 |
echo "" >>${OUT} |
| 184 |
|
| 185 |
echo "Testing listgeo albers_equal_area.tif" >> ${OUT} |
| 186 |
$EXE ${DATA_DIR}/albers_equal_area.tif >>${OUT} |
| 187 |
echo "" >>${OUT} |
| 188 |
|
| 189 |
echo "Testing listgeo ProjectedCSTypeGeoKey_3035_lambert_azimuthal_equal_area.tif" >> ${OUT} |
| 190 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_3035_lambert_azimuthal_equal_area.tif >>${OUT} |
| 191 |
echo "" >>${OUT} |
| 192 |
|
| 193 |
echo "Testing listgeo lambert_azimuthal_equal_area.tif" >> ${OUT} |
| 194 |
$EXE ${DATA_DIR}/lambert_azimuthal_equal_area.tif >>${OUT} |
| 195 |
echo "" >>${OUT} |
| 196 |
|
| 197 |
echo "Testing listgeo ProjectedCSTypeGeoKey_3410_lambert_cylindrical_equal_area.tif" >> ${OUT} |
| 198 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_3410_lambert_cylindrical_equal_area.tif >>${OUT} |
| 199 |
echo "" >>${OUT} |
| 200 |
|
| 201 |
echo "Testing listgeo lambert_cylindrical_equal_area.tif" >> ${OUT} |
| 202 |
$EXE ${DATA_DIR}/lambert_cylindrical_equal_area.tif >>${OUT} |
| 203 |
echo "" >>${OUT} |
| 204 |
|
| 205 |
echo "Testing listgeo ProjectedCSTypeGeoKey_4087_equidistant_cylindrical.tif" >> ${OUT} |
| 206 |
$EXE ${DATA_DIR}/ProjectedCSTypeGeoKey_4087_equidistant_cylindrical.tif >>${OUT} |
| 207 |
echo "" >>${OUT} |
| 208 |
|
| 209 |
echo "Testing listgeo equidistant_cylindrical.tif" >> ${OUT} |
| 210 |
$EXE ${DATA_DIR}/equidistant_cylindrical.tif >>${OUT} |
| 211 |
echo "" >>${OUT} |
| 212 |
|
| 213 |
echo "Testing listgeo pixel_is_point_wgs84.tif" >> ${OUT} |
| 214 |
$EXE ${DATA_DIR}/pixel_is_point_wgs84.tif >>${OUT} |
| 215 |
echo "" >>${OUT} |
| 216 |
|
| 217 |
# Normalize for results depending on the exact version of PROJ / EPSG database |
| 218 |
sed "s/ETRS89-extended/ETRS89/g" < ${OUT} > ${OUT}.tmp |
| 219 |
mv ${OUT}.tmp ${OUT} |
| 220 |
|
| 221 |
sed "s/Projection = 15914 (BLM zone 14N (US survey .*))/Projection = 15914 (BLM zone 14N)/g" < ${OUT} > ${OUT}.tmp |
| 222 |
mv ${OUT}.tmp ${OUT} |
| 223 |
sed "s/Projection = 6753 (Oregon Columbia River West zone (.*))/Projection = 6753 (Oregon Columbia River West zone)/" < ${OUT} > ${OUT}.tmp |
| 224 |
mv ${OUT}.tmp ${OUT} |
| 225 |
sed "s/ProjCenterLongGeoKey: 46.437229 ( 46d26'14.02\"E)/ProjCenterLongGeoKey: 46.437229 ( 46d26'14.03\"E)/" < ${OUT} > ${OUT}.tmp |
| 226 |
mv ${OUT}.tmp ${OUT} |
| 227 |
|
| 228 |
sed "s/ETRS89-extended/ETRS89/g" < ${TEST_CLI_DIR}/testlistgeo_out.dist > testlistgeo_out.dist.normalized |
| 229 |
|
| 230 |
sed "s/GCS: 4053\/Unspecified datum based upon the International 1924 Authalic Sphere/GCS: 10346\/NSIDC Authalic Sphere/g" < ${OUT} > ${OUT}.tmp |
| 231 |
mv ${OUT}.tmp ${OUT} |
| 232 |
sed "s/Datum: 6053\/Not specified (based on International 1924 Authalic Sphere)/Datum: 1360\/NSIDC International 1924 Authalic Sphere/g" < ${OUT} > ${OUT}.tmp |
| 233 |
mv ${OUT}.tmp ${OUT} |
| 234 |
|
| •235 |
sed "s/ETRS89-BEL \[BEREF2002\]/ETRS89/g" < ${OUT} > ${OUT}.tmp |
| 236 |
mv ${OUT}.tmp ${OUT} |
| 237 |
sed "s/GCS: 11063\/ETRS89/GCS: 4258\/ETRS89/g" < ${OUT} > ${OUT}.tmp |
| 238 |
mv ${OUT}.tmp ${OUT} |
| 239 |
sed "s/Datum: 1432\/Belgian Reference Frame 2002/Datum: 6258\/European Terrestrial Reference System 1989/g" < ${OUT} > ${OUT}.tmp |
| 240 |
mv ${OUT}.tmp ${OUT} |
| 241 |
|
| 242 |
sed -E "s/\( 3d57'32\.60\"E, 33d53'19\.45\"N\)/( 3d57'32.60\"E, 33d41'55.25\"N)/" < ${OUT} > ${OUT}.tmp |
| 243 |
mv ${OUT}.tmp ${OUT} |
| 244 |
sed -E "s/\( 3d57'32\.60\"E, 33d53'17\.51\"N\)/( 3d57'32.60\"E, 33d41'53.31\"N)/" < ${OUT} > ${OUT}.tmp |
| 245 |
mv ${OUT}.tmp ${OUT} |
| 246 |
sed -E "s/\( 3d57'34\.54\"E, 33d53'19\.45\"N\)/( 3d57'34.54\"E, 33d41'55.25\"N)/" < ${OUT} > ${OUT}.tmp |
| 247 |
mv ${OUT}.tmp ${OUT} |
| 248 |
sed -E "s/\( 3d57'34\.54\"E, 33d53'17\.51\"N\)/( 3d57'34.54\"E, 33d41'53.31\"N)/" < ${OUT} > ${OUT}.tmp |
| 249 |
mv ${OUT}.tmp ${OUT} |
| 250 |
sed -E "s/\( 3d57'33\.57\"E, 33d53'18\.48\"N\)/( 3d57'33.57\"E, 33d41'54.28\"N)/" < ${OUT} > ${OUT}.tmp |
| 251 |
mv ${OUT}.tmp ${OUT} |
| 252 |
|
| 253 |
sed "s/GCS: 4053\/Unspecified datum based upon the International 1924 Authalic Sphere/GCS: 10346\/NSIDC Authalic Sphere/g" < testlistgeo_out.dist.normalized > testlistgeo_out.dist.normalized.tmp |
| 254 |
mv testlistgeo_out.dist.normalized.tmp testlistgeo_out.dist.normalized |
| 255 |
sed "s/Datum: 6053\/Not specified (based on International 1924 Authalic Sphere)/Datum: 1360\/NSIDC International 1924 Authalic Sphere/g" < testlistgeo_out.dist.normalized > testlistgeo_out.dist.normalized.tmp |
| 256 |
mv testlistgeo_out.dist.normalized.tmp testlistgeo_out.dist.normalized |
| 257 |
|
| 258 |
sed "s/Projection = 15914 (BLM zone 14N (US survey .*))/Projection = 15914 (BLM zone 14N)/" < testlistgeo_out.dist.normalized > testlistgeo_out.dist.normalized.tmp |
| 259 |
mv testlistgeo_out.dist.normalized.tmp testlistgeo_out.dist.normalized |
| 260 |
sed "s/Projection = 6753 (Oregon Columbia River West zone (.*))/Projection = 6753 (Oregon Columbia River West zone)/" < testlistgeo_out.dist.normalized > testlistgeo_out.dist.normalized.tmp |
| 261 |
mv testlistgeo_out.dist.normalized.tmp testlistgeo_out.dist.normalized |
| 262 |
sed "s/ProjCenterLongGeoKey: 46.437229 ( 46d26'14.02\"E)/ProjCenterLongGeoKey: 46.437229 ( 46d26'14.03\"E)/" < testlistgeo_out.dist.normalized > testlistgeo_out.dist.normalized.tmp |
| 263 |
mv testlistgeo_out.dist.normalized.tmp testlistgeo_out.dist.normalized |
| 264 |
|
| 265 |
echo "Testing listgeo epsg_27563_only_pcs_code.tif" >> ${OUT} |
| 266 |
$EXE ${DATA_DIR}/epsg_27563_only_pcs_code.tif >>${OUT} |
| 267 |
echo "" >>${OUT} |
| 268 |
|
| 269 |
echo "Testing listgeo epsg_27563_allgeokeys.tif" >> ${OUT} |
| 270 |
$EXE ${DATA_DIR}/epsg_27563_allgeokeys.tif >>${OUT} |
| 271 |
echo "" >>${OUT} |
| 272 |
|
| 273 |
# do 'diff' with distribution results |
| 274 |
# after cleaning for avoid spurios result due |
| 275 |
# to different build dir |
| 276 |
sed -e "s/Testing listgeo .*test/Testing listgeo ..\/test/" -i ${OUT} |
| 277 |
echo "diff ${OUT} with testlistgeo_out.dist" |
| 278 |
diff -u ${OUT} testlistgeo_out.dist.normalized |
| 279 |
if [ $? -ne 0 ] ; then |
| 280 |
echo "" |
| 281 |
echo "PROBLEMS HAVE OCCURRED" |
| 282 |
echo "test file ${OUT} saved" |
| 283 |
echo |
| 284 |
exit 100 |
| 285 |
else |
| 286 |
echo "TEST OK" |
| 287 |
echo "test file ${OUT} removed" |
| 288 |
echo |
| 289 |
rm testlistgeo_out.dist.normalized |
| 290 |
/bin/rm -f ${OUT} |
| 291 |
exit 0 |
| 292 |
fi |