1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151
|
#!/bin/sh
GPSBABEL_FREEZE_TIME=y
export GPSBABEL_FREEZE_TIME
# Turn on GNU libc instrumentation.
MALLOC_CHECK_=2
export MALLOC_CHECK_
PNAME=${PNAME:-./gpsbabel}
DIFF=${DIFF:-diff}
REFERENCE=reference
# OD=${OD:-od -Ax -txC -v}
if [ -x /usr/bin/hexdump ] ; then
OD=${OD:-hexdump -v -C}
else
OD=${OD:-od -Ax -txC -v}
fi
TMPDIR=/tmp/gpsbabel.$$
mkdir -p $TMPDIR
trap "rm -fr $TMPDIR" 0 1 2 3 15
bincompare()
{
rm -f ${TMPDIR}/bc1
rm -f ${TMPDIR}/bc2
${OD} $1 >${TMPDIR}/bc1
${OD} $2 >${TMPDIR}/bc2
${DIFF} -u ${TMPDIR}/bc1 ${TMPDIR}/bc2 || {
echo ERROR binary comparing $*
exit 1
}
}
compare()
{
${DIFF} $* || {
echo ERROR comparing $*
exit 1
}
}
sort_and_compare()
{
sort $1 > $TMPDIR/s1
sort $2 > $TMPDIR/s2
compare $TMPDIR/s1 $TMPDIR/s2
}
# Some formats are just too boring to test. The ones that
# are xcsv include
# garmin301
# garmin_poi
# gpsdrivetrack
# nima
# mapconverter
# geonet
# saplus
# s_and_t
# xmap2006
# cambridge
# cup
# Geocaching .loc
rm -f ${TMPDIR}/gl.loc
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o geo -F ${TMPDIR}/gl.loc
compare ${TMPDIR}/gl.loc ${REFERENCE}
# GPSUtil
rm -f ${TMPDIR}/gu.wpt ${TMPDIR}/1.gpx ${TMPDIR}/2.gpx
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o gpsutil -F ${TMPDIR}/gu.wpt
compare ${TMPDIR}/gu.wpt ${REFERENCE}
${PNAME} -i gpsutil -f ${TMPDIR}/gu.wpt -o gpx -F ${TMPDIR}/1.gpx
${PNAME} -i gpsutil -f ${REFERENCE}/gu.wpt -o gpx -F ${TMPDIR}/2.gpx
compare ${TMPDIR}/1.gpx ${TMPDIR}/2.gpx
# GPSman
rm -f ${TMPDIR}/gm.gm ${TMPDIR}/gm.gm+
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o gpsman -F ${TMPDIR}/gm.gm
${PNAME} -i gpsman -f ${TMPDIR}/gm.gm -o gpsutil -F ${TMPDIR}/gm.gm+
compare ${TMPDIR}/gm.gm+ ${TMPDIR}/gu.wpt
# GPX
rm -f ${TMPDIR}/gl.gpx ${TMPDIR}/gpx.gpx
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o gpx -F ${TMPDIR}/gl.gpx
${PNAME} -i gpx -f ${TMPDIR}/gl.gpx -o gpsutil -F ${TMPDIR}/gpx.gpx
compare ${TMPDIR}/gpx.gpx ${TMPDIR}/gu.wpt
# GTM
rm -f ${TMPDIR}/gl.gpx ${TMPDIR}/gpx.gpx
${PNAME} -i gtm -f ${REFERENCE}/sample.gtm -o gpx -F ${TMPDIR}/gtm1.gpx
${PNAME} -i gpx -f ${TMPDIR}/gtm1.gpx -o gtm -F ${TMPDIR}/gtm.gtm
${PNAME} -i gtm -f ${TMPDIR}/gtm.gtm -o gpx -F ${TMPDIR}/gtm2.gpx
compare ${TMPDIR}/gtm1.gpx ${TMPDIR}/gtm2.gpx
bincompare ${TMPDIR}/gtm.gtm ${REFERENCE}/sample.gtm
# Magellan Mapsend
rm -f ${TMPDIR}/mm.mapsend ${TMPDIR}/mm.gps
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o mapsend -F ${TMPDIR}/mm.mapsend
${PNAME} -i mapsend -f ${TMPDIR}/mm.mapsend -o gpsutil -F ${TMPDIR}/mm.gps
compare ${TMPDIR}/mm.gps ${TMPDIR}/gu.wpt
# Magellan serial
# TODO
# Tiger
# This one is a little tacky, becuase it's a very lossy format.
# so we simply test we can write it, and then read it and write it and
# get an identical file back.
rm -f ${TMPDIR}/tiger
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o tiger -F ${TMPDIR}/tiger
${PNAME} -i tiger -f ${TMPDIR}/tiger -o tiger -F ${TMPDIR}/tiger2
compare ${TMPDIR}/tiger ${TMPDIR}/tiger2
#
# Lowrance USR. Binary, and also slightly lossy because of the math to
# convert lat/long. It also doesn't support description, which makes it
# awkward to test.
#
rm -f ${TMPDIR}/lowrance1.usr
rm -f ${TMPDIR}/enchilada1.usr
rm -f ${TMPDIR}/enchilada.gpx
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o lowranceusr -F ${TMPDIR}/lowrance1.usr
bincompare ${TMPDIR}/lowrance1.usr ${REFERENCE}/lowrance.usr
${PNAME} -i lowranceusr -f ${TMPDIR}/lowrance1.usr -o lowranceusr -F ${TMPDIR}/lowrance1.usr
# And because of the FP rounding, we can't even read our file, write it back
# and get the same data. Sigh.
# bincompare ${REFERENCE}/lowrance.usr ${TMPDIR}/lowrance1.usr
${PNAME} -i lowranceusr -f ${REFERENCE}/all.usr -o gpx -F ${TMPDIR}/enchilada.gpx
${PNAME} -i gpx -f ${TMPDIR}/enchilada.gpx -o lowranceusr -F ${TMPDIR}/enchilada1.usr
bincompare ${TMPDIR}/enchilada1.usr ${REFERENCE}/enchilada.usr
# Don't convert icons as waypts
${PNAME} -i lowranceusr,ignoreicons -f ${REFERENCE}/all.usr -o gpx -F ${TMPDIR}/enchilada.gpx
${PNAME} -i gpx -f ${TMPDIR}/enchilada.gpx -o lowranceusr -F ${TMPDIR}/enchilada1.usr
bincompare ${TMPDIR}/enchilada1.usr ${REFERENCE}/ignoreicons.usr
# CSV (Comma separated value) data.
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o csv -F ${TMPDIR}/csv.csv
${PNAME} -i csv -f ${TMPDIR}/csv.csv -o csv -F ${TMPDIR}/csv2.csv
compare ${TMPDIR}/csv2.csv ${TMPDIR}/csv.csv
#
# Delorme TopoUSA 4 is a CSV strain.
#
rm -f ${TMPDIR}/xmap-1.gpx ${TMPDIR}/xmap-2.gpx ${TMPDIR}/xmap
${PNAME} -i xmap -f ${REFERENCE}/xmap -o xmap -F ${TMPDIR}/xmap
${PNAME} -i xmap -f ${REFERENCE}/xmap -o gpx -F ${TMPDIR}/xmap-1.gpx
${PNAME} -i xmap -f ${TMPDIR}/xmap -o gpx -F ${TMPDIR}/xmap-2.gpx
compare ${TMPDIR}/xmap-1.gpx ${TMPDIR}/xmap-2.gpx
compare ${REFERENCE}/xmap ${TMPDIR}/xmap
# PCX (Garmin mapsource import) file format
rm -f ${TMPDIR}/mm.pcx ${TMPDIR}/pcx.gps
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o pcx -F ${TMPDIR}/mm.pcx
${PNAME} -i pcx -f ${TMPDIR}/mm.pcx -o gpsutil -F ${TMPDIR}/pcx.gps
compare ${TMPDIR}/mm.gps ${TMPDIR}/gu.wpt
${PNAME} -t -i gpx -f ${REFERENCE}/track/tracks.gpx -o pcx -F ${TMPDIR}/pcx.trk
${PNAME} -t -i pcx -f ${REFERENCE}/track/pcx.trk -o pcx -F ${TMPDIR}/pcx2.trk
compare ${TMPDIR}/pcx.trk ${TMPDIR}/pcx2.trk
#
# Magellan file format
#
${PNAME} -i magellan -f ${REFERENCE}/magfile -o magellan -F ${TMPDIR}/magfile
compare ${TMPDIR}/magfile ${REFERENCE}/magfile
#
# Magellanx is just like, but with longer names. (which this admittedly
# doesn't actually exercise...)
#
${PNAME} -i magellan -f ${REFERENCE}/magfile -o magellanx -F ${TMPDIR}/magfile2
compare ${TMPDIR}/magfile2 ${REFERENCE}/magfile
# Magellanx routes, however, have an extra 'name' field in them.
${PNAME} -r -i magellanx -f ${REFERENCE}/route/magexplorist.rte -o magellanx -F ${TMPDIR}/magxfile.rte
${PNAME} -r -i magellanx -f ${TMPDIR}/magxfile.rte -o magellanx -F ${TMPDIR}/magxfile2.rte
compare ${TMPDIR}/magxfile2.rte ${REFERENCE}/route/magexplorist.rte
# Navitrak DNA marker format
${PNAME} -i dna -f ${REFERENCE}/dnatest.txt -o dna -F ${TMPDIR}/dnatest.txt
compare ${TMPDIR}/dnatest.txt ${REFERENCE}/dnatest.txt
# PSP (PocketStreets 2002 Pushpin (.PSP)) file format. Use mxf as an
# intermediate format to avoid binary FP anomalies on compareerent platforms.
rm -f ${TMPDIR}/psp.mxf ${TMPDIR}/mxf.psp
${PNAME} -i psp -f ${REFERENCE}/ps.psp -o mxf -F ${TMPDIR}/psp.mxf
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o mxf -F ${TMPDIR}/mxf.psp
compare ${TMPDIR}/psp.mxf ${TMPDIR}/mxf.psp
${PNAME} -i psp -f ${REFERENCE}/ps.psp -o gpx -F ${TMPDIR}/psp1.gpx
${PNAME} -i psp -f ${REFERENCE}/ps.psp -o psp -F ${TMPDIR}/xxx.psp
${PNAME} -i psp -f ${TMPDIR}/xxx.psp -o gpx -F ${TMPDIR}/psp2.gpx
compare ${TMPDIR}/psp1.gpx ${TMPDIR}/psp2.gpx
# MXF (Maptech Exchange Format) file format
rm -f ${TMPDIR}/mx.mxf ${TMPDIR}/mxf.mxf
${PNAME} -i mxf -f ${REFERENCE}/mxf.mxf -o mxf -F ${TMPDIR}/mx.mxf
${PNAME} -i mxf -f ${TMPDIR}/mx.mxf -o mxf -F ${TMPDIR}/mxf.mxf
compare ${TMPDIR}/mxf.mxf ${REFERENCE}
# tmpro (TopoMapPro Places) file format
rm -f ${TMPDIR}/topomappro.txt ${TMPDIR}/mxf.mxf
${PNAME} -i tmpro -f ${REFERENCE}/topomappro.txt -o tmpro -F ${TMPDIR}/tmp.txt
${PNAME} -i tmpro -f ${TMPDIR}/tmp.txt -o tmpro -F ${TMPDIR}/topomappro.txt
compare ${TMPDIR}/topomappro.txt ${REFERENCE}
# TPG (NG Topo!) file format
# This is hard to test as the datum conversions create minute
# inconsistencies in the coordinates. So.. we test our i/o
# against a format that rounds higher than we care to compare
# for binary data.
rm -f ${TMPDIR}/topo.mxf ${TMPDIR}/tpg.mxf ${TMPDIR}/geo.tpg
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o tpg -F ${TMPDIR}/geo.tpg
${PNAME} -i tpg -f ${TMPDIR}/geo.tpg -o mxf -F ${TMPDIR}/tpg.mxf
${PNAME} -i tpg -f ${REFERENCE}/tpg.tpg -o mxf -F ${TMPDIR}/topo.mxf
compare ${TMPDIR}/tpg.mxf ${TMPDIR}/topo.mxf
# TPO (NG Topo!) file format
# This is hard to test as the datum conversions create minute
# inconsistencies in the coordinates. We have four reference files:
# tpo-sample1.tpo, tpo-sample1.gpx, tpo-sample2.gpx, and
# tpo-sample2.tpo. These are used to check the conversion to/from
# TPO format.
#
# Version 2.x tests
rm -f ${TMPDIR}/tpo-sample1.gpx ${TMPDIR}/tpo-sample2.tpo
${PNAME} -t -i tpo2 -f reference/track/tpo-sample1.tpo -o gpx -F ${TMPDIR}/tpo-sample1.gpx
compare ${TMPDIR}/tpo-sample1.gpx reference/track/tpo-sample1.gpx
#${PNAME} -t -i gpx -f reference/track/tpo-sample2.gpx -o tpo2 -F ${TMPDIR}/tpo-sample2.tpo
#bincompare ${TMPDIR}/tpo-sample2.tpo reference/track/tpo-sample2.tpo
#
# Version 3.x tests. Remove the timestamp from the generated file
# so that the compare will succeed.
rm -f ${TMPDIR}/tpo-sample3.gpx ${TMPDIR}/tpo-sample3.gpx2
${PNAME} -t -r -w -i tpo3 -f reference/tpo-sample3.tpo -o gpx -F ${TMPDIR}/tpo-sample3.gpx
# Remove the timestamp
grep -v time <${TMPDIR}/tpo-sample3.gpx >${TMPDIR}/tpo-sample3.gpx2
compare ${TMPDIR}/tpo-sample3.gpx2 reference/tpo-sample3.gpx
# OZI (OziExplorer 1.1) file format
rm -f ${TMPDIR}/oz.wpt ${TMPDIR}/ozi.wpt
${PNAME} -i ozi -f ${REFERENCE}/ozi.wpt -o ozi -F ${TMPDIR}/oz.wpt
${PNAME} -i ozi -f ${TMPDIR}/oz.wpt -o ozi -F ${TMPDIR}/ozi.wpt
compare ${TMPDIR}/ozi.wpt ${REFERENCE}
# Holux support is a little funky to test. Becuase it loses precision,
# if we convert it to another format, we lose accuracy (rounding) in the
# coords, so converting it so something else and comparing it never works.
# So we verify that we can read the reference and write it and get an
# identical reference.
${PNAME} -i holux -f ${REFERENCE}/paris.wpo -o holux -F ${TMPDIR}/paris.wpo
# compare ${REFERENCE}/paris.wpo ${TMPDIR}/paris.wpo
# Magellan NAV Companion for PalmOS
# This format is hard to test, because each record and the database itself
# contains the time of creation, so two otherwise identical files won't
# compare accurately. In any case, the files are binary so compare wouldn't
# like them. So, we convert the reference file to gpsutil and the converted
# file to gpsutil and make sure they're the same, and that they're the same
# as one converted on a known-working installation. Unfortunately, this does
# not verify that the appinfo block was written correctly. However, it does
# successfully test for some endianness errors that might otherwise go
# unnoticed.
rm -f ${TMPDIR}/magnav.pdb ${TMPDIR}/magnav.gpu ${TMPDIR}/magnavt.gpu
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o magnav -F ${TMPDIR}/magnav.pdb
${PNAME} -i magnav -f ${TMPDIR}/magnav.pdb -o gpsutil -F ${TMPDIR}/magnav.gpu
${PNAME} -i magnav -f ${REFERENCE}/magnav.pdb -o gpsutil -F ${TMPDIR}/magnavt.gpu
compare ${TMPDIR}/magnavt.gpu ${TMPDIR}/magnav.gpu
compare ${REFERENCE}/gu.wpt ${TMPDIR}/magnav.gpu
rm -f ${TMPDIR}/magnav.pdb
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o magnav -F ${TMPDIR}/magnav.pdb
bincompare ${TMPDIR}/magnav.pdb ${REFERENCE}/magnav.pdb
# GPSPilot Tracker for PalmOS
# This test is eerily similar to the NAV Companion test. In fact, the
# converted reference file (magnavr.gpu) is identical.
rm -f ${TMPDIR}/gpspilot.pdb ${TMPDIR}/gpspilot.gpu ${TMPDIR}/gpspil_t.gpu
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o gpspilot -F ${TMPDIR}/gpspilot.pdb
${PNAME} -i gpspilot -f ${TMPDIR}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspilot.gpu
${PNAME} -i gpspilot -f ${REFERENCE}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspil_t.gpu
compare ${TMPDIR}/gpspil_t.gpu ${TMPDIR}/gpspilot.gpu
compare ${REFERENCE}/gu.wpt ${TMPDIR}/gpspilot.gpu
# Cetus GPS for PalmOS
# This test is also similar to the NAV Companion test.
rm -f ${TMPDIR}/cetus.pdb ${TMPDIR}/cetus.gpu ${TMPDIR}/cetust.gpu
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o cetus -F ${TMPDIR}/cetus.pdb
${PNAME} -i cetus -f ${TMPDIR}/cetus.pdb -o gpsutil -F ${TMPDIR}/cetus.gpu
${PNAME} -i cetus -f ${REFERENCE}/cetus.pdb -o gpsutil -F ${TMPDIR}/cetust.gpu
compare ${TMPDIR}/cetust.gpu ${TMPDIR}/cetus.gpu
compare ${REFERENCE}/cetus.gpu ${TMPDIR}/cetus.gpu
# QuoVadis GPS for PalmOS
# This test is derived from the Cetus test above.
rm -f ${TMPDIR}/quovadis.pdb ${TMPDIR}/quovadis.gpu ${TMPDIR}/quovadist.gpu
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o quovadis -F ${TMPDIR}/quovadis.pdb
${PNAME} -i quovadis -f ${TMPDIR}/quovadis.pdb -o gpsutil -F ${TMPDIR}/quovadis.gpu
${PNAME} -i quovadis -f ${REFERENCE}/quovadis.pdb -o gpsutil -F ${TMPDIR}/quovadist.gpu
compare ${TMPDIR}/quovadist.gpu ${TMPDIR}/quovadis.gpu
compare ${REFERENCE}/quovadis.gpu ${TMPDIR}/quovadis.gpu
# GpsDrive
rm -f ${TMPDIR}/gpsdrive.txt
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o gpsdrive -F ${TMPDIR}/gpsdrive.txt
compare ${TMPDIR}/gpsdrive.txt ${REFERENCE}
${PNAME} -i gpsdrive -f ${REFERENCE}/gpsdrive.txt -o gpsdrive -F ${TMPDIR}/gpsdrive2.txt
compare ${TMPDIR}/gpsdrive2.txt ${REFERENCE}/gpsdrive.txt
# XMapHH Street Atlas USA file format
rm -f ${TMPDIR}/xmapwpt.wpt ${TMPDIR}/xmapwpt.xmapwpt
${PNAME} -i xmapwpt -f ${REFERENCE}/xmapwpt.wpt -o xmapwpt -F ${TMPDIR}/xmapwpt.xmapwpt
${PNAME} -i xmapwpt -f ${TMPDIR}/xmapwpt.xmapwpt -o xmapwpt -F ${TMPDIR}/xmapwpt.wpt
compare ${TMPDIR}/xmapwpt.wpt ${REFERENCE}
# XCSV
# Test that we can parse a style file, and read and write data in the
# same xcsv format (a complete test is virtually impossible).
echo "RECORD_DELIMITER NEWLINE" > ${TMPDIR}/testo.style
echo "FIELD_DELIMITER COMMA" >> ${TMPDIR}/testo.style
echo "BADCHARS COMMA" >> ${TMPDIR}/testo.style
echo "PROLOGUE Header" >> ${TMPDIR}/testo.style
echo "EPILOGUE Footer" >> ${TMPDIR}/testo.style
echo "IFIELD SHORTNAME,,%s" >> ${TMPDIR}/testo.style
echo "IFIELD LAT_DIRDECIMAL,,%c%lf" >> ${TMPDIR}/testo.style
echo "IFIELD LON_DECIMALDIR,,%lf%c" >> ${TMPDIR}/testo.style
rm -f ${TMPDIR}/xcsv.geo ${TMPDIR}/xcsv.xcsv
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o xcsv,style=${TMPDIR}/testo.style -F ${TMPDIR}/xcsv.geo
${PNAME} -i xcsv,style=${TMPDIR}/testo.style -f ${TMPDIR}/xcsv.geo -o xcsv,style=${TMPDIR}/testo.style -F ${TMPDIR}/xcsv.xcsv
compare ${TMPDIR}/xcsv.geo ${TMPDIR}/xcsv.xcsv
# Garmin Mapsource This is a binary format with some undocumented
# fields. This test is therefore intentionally vague. We read a file,
# convert it to GPX, then write a file as MPS, then read it back and
# write it as GPX and compare them. Since we're writing both GPX files
# ourselves from the same version, we're immune to changes in our own
# GPX output.
rm -fr ${TMPDIR}/ms.gpx ${TMPDIR}/ms[12].gpx
${PNAME} -i mapsource -f ${REFERENCE}/mapsource.mps -o gpx -F ${TMPDIR}/ms1.gpx
${PNAME} -i mapsource -f ${REFERENCE}/mapsource.mps -o mapsource -F ${TMPDIR}/ms.mps
${PNAME} -i mapsource -f ${TMPDIR}/ms.mps -o gpx -F ${TMPDIR}/ms2.gpx
compare ${TMPDIR}/ms1.gpx ${TMPDIR}/ms2.gpx
#
# MRCB mapsource track test
#
rm -f ${TMPDIR}/mps-track.mps
${PNAME} -t -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \
-F ${TMPDIR}/mps-track.mps
compare ${TMPDIR}/mps-track.mps ${REFERENCE}/track/
# Now do a test of reading waypoints from a track-only file - should have an empty result
rm -f ${TMPDIR}/mps-track.mps
${PNAME} -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \
-F ${TMPDIR}/mps-track.mps
compare ${TMPDIR}/mps-track.mps ${REFERENCE}/mps-empty.mps
#
# MRCB mapsource route test
#
rm -f ${TMPDIR}/mps-route.mps
${PNAME} -r -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=4 \
-F ${TMPDIR}/mps-route.mps
compare ${TMPDIR}/mps-route.mps ${REFERENCE}/route/route.mps
# Now do a test of reading tracks from a route-only file - should have an empty result
rm -f ${TMPDIR}/mps-route.mps
${PNAME} -t -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=3 \
-F ${TMPDIR}/mps-route.mps
compare ${TMPDIR}/mps-route.mps ${REFERENCE}/mps-empty.mps
#
# Geocaching Database is a binary Palm format that, like the GPX variants
# has a zillion "equivalent" encodings of any given record set. So we
# read the reference file, spin it to GPX and back to GCDB and then spin
# that one to GPX.
#
${PNAME} -i gcdb -f ${REFERENCE}/GeocachingDB.PDB -o gpx -F ${TMPDIR}/gcdb1.gpx \
-o gcdb -F ${TMPDIR}/gcdb1.pdb
${PNAME} -i gpx -f ${TMPDIR}/gcdb1.gpx -o gpx -F ${TMPDIR}/gcdb2.gpx
compare ${TMPDIR}/gcdb1.gpx ${TMPDIR}/gcdb1.gpx
#
# Duplicate filter - Since filters have no format of their own, we use csv
# as an intermediate format for testing the filter.
#
rm -f ${TMPDIR}/filterdupe.csv1 ${TMPDIR}/filterdupe.csv2
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o csv -F ${TMPDIR}/filterdupe.csv1
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -f ${REFERENCE}/../geocaching.loc -x duplicate,shortname \
-o csv -F ${TMPDIR}/filterdupe.csv2
sort_and_compare ${TMPDIR}/filterdupe.csv1 ${TMPDIR}/filterdupe.csv2
#
# Position filter - Since very small distances are essentialy a duplicate
# position filter, we can test very similarly to the duplicate filter.
#
rm -f ${TMPDIR}/filterpos.csv1 ${TMPDIR}/filterpos.csv2
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o csv -F ${TMPDIR}/filterpos.csv1
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -f ${REFERENCE}/../geocaching.loc -x position,distance=5f \
-o csv -F ${TMPDIR}/filterpos.csv2
sort_and_compare ${TMPDIR}/filterpos.csv1 ${TMPDIR}/filterpos.csv2
#
# Radius filter
#
rm -f ${TMPDIR}/radius.csv
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc \
-x radius,lat=35.9720,lon=-87.1347,distance=14.7 \
-o csv -F ${TMPDIR}/radius.csv
compare ${TMPDIR}/radius.csv ${REFERENCE}/
#
# magellan SD card waypoint / route format
#
rm -f ${TMPDIR}/magellan.rte
${PNAME} -r -i magellan -f ${REFERENCE}/route/magellan.rte -o magellan \
-F ${TMPDIR}/magellan.rte
compare ${TMPDIR}/magellan.rte ${REFERENCE}/route/magellan.rte
#
# GPX routes -- since GPX contains a date stamp, tests will always
# fail, so we use magellan as an interim format...
#
rm -f ${TMPDIR}/gpxroute.gpx ${TMPDIR}/maggpx.rte
${PNAME} -r -i gpx -f ${REFERENCE}/route/route.gpx -o gpx \
-F ${TMPDIR}/gpxroute.gpx
${PNAME} -r -i gpx -f ${TMPDIR}/gpxroute.gpx -o magellan \
-F ${TMPDIR}/maggpx.rte
compare ${TMPDIR}/maggpx.rte ${REFERENCE}/route/magellan.rte
#
# GPX tracks -- since GPX contains a date stamp, tests will always
# fail, so we use magellan as an interim format...
#
rm -f ${TMPDIR}/gpxtrack.gpx ${TMPDIR}/maggpx.trk
${PNAME} -t -i gpx -f ${REFERENCE}/track/tracks.gpx -o gpx \
-F ${TMPDIR}/gpxtrack.gpx
${PNAME} -t -i magellan -f ${REFERENCE}/track/meridian.trk -o gpx \
-F ${TMPDIR}/maggpx.trk
compare ${TMPDIR}/maggpx.trk ${TMPDIR}/gpxtrack.gpx
#
# MAPSEND waypoint / route format
#
rm -f ${TMPDIR}/route.mapsend
${PNAME} -r -i mapsend -f ${REFERENCE}/route/route.mapsend -o mapsend \
-F ${TMPDIR}/route.mapsend
bincompare ${TMPDIR}/route.mapsend ${REFERENCE}/route/route.mapsend
#
# MAPSEND track format
#
rm -f ${TMPDIR}/mapsend.trk
${PNAME} -t -i mapsend -f ${REFERENCE}/track/mapsend.trk -o mapsend,trkver=3 \
-F ${TMPDIR}/mapsend.trk
compare ${TMPDIR}/mapsend.trk ${REFERENCE}/track/
#
# copilot
#
rm -f ${TMPDIR}/copilot.pdb
${PNAME} -i copilot -f ${REFERENCE}/UKultralight.pdb -o copilot -F ${TMPDIR}/cop.pdb
${PNAME} -i copilot -f ${REFERENCE}/UKultralight.pdb -o gpx -F ${TMPDIR}/cop1.gpx
${PNAME} -i copilot -f ${TMPDIR}/cop.pdb -o gpx -F ${TMPDIR}/cop2.gpx
compare ${TMPDIR}/cop1.gpx ${TMPDIR}/cop2.gpx
#
# EasyGPS. Another binary format.
#
rm -f ${TMPDIR}/easy.loc
${PNAME} -i easygps -f ${REFERENCE}/easygps.loc -o easygps -F ${TMPDIR}/ez.loc
${PNAME} -i easygps -f ${REFERENCE}/easygps.loc -o gpx -F ${TMPDIR}/ez1.gpx
${PNAME} -i easygps -f ${TMPDIR}/ez.loc -o gpx -F ${TMPDIR}/ez2.gpx
compare ${TMPDIR}/ez1.gpx ${TMPDIR}/ez2.gpx
#
# GPilotS. A Palm format. Another binary format that
#
# rm -f ${TMPDIR/gpilots.l
#${PNAME} -i easygps -f ${REFERENCE}/gpilots.pdb -o gpx -F ${TMPDIR}/gp.gpx
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o gpilots -F ${TMPDIR}/blah.pdb
${PNAME} -i gpilots -f ${TMPDIR}/blah.pdb -o gpx -F ${TMPDIR}/1.gpx
${PNAME} -i gpilots -f ${REFERENCE}/gpilots.pdb -o gpx -F ${TMPDIR}/2.gpx
compare ${TMPDIR}/1.gpx ${TMPDIR}/2.gpx
#${PNAME} -i easygps -f ${REFERENCE}/gpilots.pdb -o gpx -F ${TMPDIR}/gp.gpx
#
# Navicache.
${PNAME} -i navicache -f ${REFERENCE}/navicache.xml -o gpsutil -F ${TMPDIR}/navi.wpt
compare ${TMPDIR}/navi.wpt ${REFERENCE}/navicache.ref
#
#
# CoastalExplorer..
${PNAME} -r -i coastexp -f ${REFERENCE}/coastexp.nob -o gpx -F ${TMPDIR}/coastexp.gpx
compare ${TMPDIR}/coastexp.gpx ${REFERENCE}/coastexp.ref
${PNAME} -r -i gpx -f ${TMPDIR}/coastexp.gpx -o coastexp -F ${TMPDIR}/coastexp.nob
compare ${TMPDIR}/coastexp.nob ${REFERENCE}/coastexp.ref2
${PNAME} -w -i coastexp -f ${REFERENCE}/coastexp.nob -o gpx -F ${TMPDIR}/coastexp.gpx
compare ${TMPDIR}/coastexp.gpx ${REFERENCE}/coastexp.ref3
${PNAME} -w -i gpx -f ${TMPDIR}/coastexp.gpx -o coastexp -F ${TMPDIR}/coastexp.nob
compare ${TMPDIR}/coastexp.nob ${REFERENCE}/coastexp.ref4
#
# PsiTrex. A text format that can't be handled by XCSV due to context of
# data based on other data values in the file
# Waypoints first
rm -f ${TMPDIR}/psit-ww.txt ${TMPDIR}/psit-ww.mps
${PNAME} -i psitrex -f ${REFERENCE}/psitwpts.txt -o mapsource -F ${TMPDIR}/psit-ww.mps
${PNAME} -i mapsource -f ${TMPDIR}/psit-ww.mps -o psitrex -F ${TMPDIR}/psit-ww.txt
compare ${REFERENCE}/psitwpts.txt ${TMPDIR}/psit-ww.txt
# Now test correct "empty" handling - ask for routes when there aren't any
# Uses mapsource as the empty handling for this has already happened above
rm -f ${TMPDIR}/psit-wr.mps
${PNAME} -r -i psitrex -f ${REFERENCE}/psitwpts.txt -o mapsource,mpsverout=3 -F ${TMPDIR}/psit-wr.mps
compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/psit-wr.mps
# Routes next
rm -f ${TMPDIR}/psit-rr.txt ${TMPDIR}/psit-rr.mps
${PNAME} -r -i psitrex -f ${REFERENCE}/route/psitrtes.txt -o mapsource -F ${TMPDIR}/psit-rr.mps
${PNAME} -r -i mapsource -f ${TMPDIR}/psit-rr.mps -o psitrex -F ${TMPDIR}/psit-rr.txt
compare ${REFERENCE}/route/psitrtes.txt ${TMPDIR}/psit-rr.txt
# Now test correct "empty" handling - ask for tracks when there aren't any
# Uses mapsource as the empty handling for this has already happened above
rm -f ${TMPDIR}/psit-rt.mps
${PNAME} -t -i psitrex -f ${REFERENCE}/route/psitrtes.txt -o mapsource,mpsverout=3 -F ${TMPDIR}/psit-rt.mps
compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/psit-rt.mps
# Tracks last
rm -f ${TMPDIR}/psit-tt.txt ${TMPDIR}/psit-tt.mps
${PNAME} -t -i psitrex -f ${REFERENCE}/track/psittrks.txt -o mapsource -F ${TMPDIR}/psit-tt.mps
${PNAME} -t -i mapsource -f ${TMPDIR}/psit-tt.mps -o psitrex -F ${TMPDIR}/psit-tt.txt
compare ${REFERENCE}/track/psittrks.txt ${TMPDIR}/psit-tt.txt
# Now test correct "empty" handling - ask for waypoints when there aren't any
# Uses mapsource as the empty handling for this has already happened above
rm -f ${TMPDIR}/psit-tw.mps
${PNAME} -i psitrex -f ${REFERENCE}/track/psittrks.txt -o mapsource,mpsverout=3 -F ${TMPDIR}/psit-tw.mps
compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/psit-tw.mps
#
# Arc Distance filter
#
rm -f ${TMPDIR}/arcdist.txt
${PNAME} -i xmap -f ${REFERENCE}/arcdist_input.txt \
-x arc,file=${REFERENCE}/arcdist_arc.txt,distance=1 \
-o xmap -F ${TMPDIR}/arcdist.txt
compare ${TMPDIR}/arcdist.txt ${REFERENCE}/arcdist_output.txt
#
# Polygon filter
#
rm -f ${TMPDIR}/polygon.txt
${PNAME} -i xmap -f ${REFERENCE}/arcdist_input.txt \
-x polygon,file=${REFERENCE}/polygon_allencty.txt \
-o xmap -F ${TMPDIR}/polygon.txt
compare ${TMPDIR}/polygon.txt ${REFERENCE}/polygon_output.txt
#
# Simplify filter
#
rm -f ${TMPDIR}/simplify.txt
${PNAME} -r -i gpx -f ${REFERENCE}/route/route.gpx \
-x simplify,count=10 \
-o arc -F ${TMPDIR}/simplify.txt
compare ${TMPDIR}/simplify.txt ${REFERENCE}/simplify_output.txt
#
# Route reversal filter. Do it twice and be sure we get what we
# started with.
#
rm -f ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc ${TMPDIR}/reference.arc
${PNAME} -r -i gpx -f ${REFERENCE}/route/route.gpx \
-o arc -F ${TMPDIR}/reference.arc
${PNAME} -r -i gpx -f ${REFERENCE}/route/route.gpx \
-x reverse \
-o arc -F ${TMPDIR}/reverse1.arc
${PNAME} -r -i gpx -f ${REFERENCE}/route/route.gpx \
-x reverse \
-x reverse \
-o arc -F ${TMPDIR}/reverse2.arc
# Verify the first and last are the same
compare ${TMPDIR}/reference.arc ${TMPDIR}/reverse2.arc
# Verify the first and second are different.
#${DIFF} ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc > /dev/null && {
# echo ERROR Failed reversal test.
# exit 1
#}
# parkrrrr: This isn't a straightforward compare; we *want* it to fail.
# Obviously this test should just be rewritten with a new reference.
#compare ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc
#
# Geoniche: No reference file was available, so we created one and just
# test it against itself.
#
rm -f ${TMPDIR}/gn.pdb ${TMPDIR}/1.gpx ${TMPDIR}/2.gpx
${PNAME} -i geoniche -f ${REFERENCE}/geoniche.pdb -o geoniche -F ${TMPDIR}/gn.pdb
${PNAME} -i geoniche -f ${REFERENCE}/geoniche.pdb -o gpx -F ${TMPDIR}/1.gpx
${PNAME} -i geoniche -f ${TMPDIR}/gn.pdb -o gpx -F ${TMPDIR}/2.gpx
compare ${TMPDIR}/1.gpx ${TMPDIR}/2.gpx
#
${PNAME} -i geoniche -f ${REFERENCE}/gn-targets.pdb -o gpx -F ${TMPDIR}/gn-targets.gpx
compare ${TMPDIR}/gn-targets.gpx ${REFERENCE}/gn-targets.gpx
#
# saroute covers *.anr, *.rte, and *.rtd, but I only have an .anr for testing.
# Unfortunately for us, this is a read-only format for now.
#
${PNAME} -t -i saroute -f ${REFERENCE}/track/i65.anr -o gpx -F ${TMPDIR}/gpl1.gpx
${PNAME} -t -i gpx -f ${REFERENCE}/track/i65.anr.gpx -o gpx -F ${TMPDIR}/gpl2.gpx
compare ${TMPDIR}/gpl1.gpx ${TMPDIR}/gpl2.gpx
#
# Delorme GPL file. This is sort of a track format.
#
rm -f ${TMPDIR}/gpl1.gpx ${TMPDIR}/gpl2.gpx ${TMPDIR}/gpl1.gpl
${PNAME} -t -i gpl -f ${REFERENCE}/track/webpark1.gpl -o gpx -F ${TMPDIR}/gpl1.gpx
${PNAME} -t -i gpl -f ${REFERENCE}/track/webpark1.gpl -o gpl -F ${TMPDIR}/gpl1.gpl
${PNAME} -t -i gpl -f ${TMPDIR}/gpl1.gpl -o gpx -F ${TMPDIR}/gpl2.gpx
compare ${TMPDIR}/gpl1.gpx ${TMPDIR}/gpl2.gpx
#
# NetStumbler Summary File (read-only)
#
rm -f ${TMPDIR}/netstumbler.mps
${PNAME} -i netstumbler -f ${REFERENCE}/netstumbler.txt -o mapsource -F ${TMPDIR}/netstumbler.mps
bincompare ${TMPDIR}/netstumbler.mps ${REFERENCE}/netstumbler.mps
#
# IGC tests
#
rm -f ${TMPDIR}/igc*out
${PNAME} -i gpx -f ${REFERENCE}/igc1.gpx -o igc -F ${TMPDIR}/igc.out
sed '/^LXXXGenerated by GPSBabel Version/d' ${TMPDIR}/igc.out > ${TMPDIR}/igc_sed.out
compare ${TMPDIR}/igc_sed.out ${REFERENCE}/igc1_igc.out
${PNAME} -i igc -f ${TMPDIR}/igc.out -o gpx -F ${TMPDIR}/igc.gpx
compare ${TMPDIR}/igc.gpx ${REFERENCE}/igc1_gpx.out
${PNAME} -i gpx -f ${TMPDIR}/igc.gpx -o igc -F ${TMPDIR}/igc.out
sed '/^LXXXGenerated by GPSBabel Version/d' ${TMPDIR}/igc.out > ${TMPDIR}/igc_sed.out
compare ${TMPDIR}/igc_sed.out ${REFERENCE}/igc1_igc.out
${PNAME} -i gpx -f ${REFERENCE}/igc1_baro.gpx -i igc -f ${REFERENCE}/igc1_igc.out -o igc,timeadj=auto -F ${TMPDIR}/igc.out
sed '/^LXXXGenerated by GPSBabel Version/d' ${TMPDIR}/igc.out > ${TMPDIR}/igc_sed.out
compare ${TMPDIR}/igc_sed.out ${REFERENCE}/igc1_3d.out
${PNAME} -i igc -f ${REFERENCE}/igc2.igc -o gpx -F ${TMPDIR}/igc.gpx
compare ${TMPDIR}/igc.gpx ${REFERENCE}/igc2_gpx.out
${PNAME} -i gpx -f ${TMPDIR}/igc.gpx -o igc -F ${TMPDIR}/igc.out
sed '/^LXXXGenerated by GPSBabel Version/d' ${TMPDIR}/igc.out > ${TMPDIR}/igc_sed.out
compare ${TMPDIR}/igc_sed.out ${REFERENCE}/igc2_igc.out
${PNAME} -i igc -f ${TMPDIR}/igc.out -o gpx -F ${TMPDIR}/igc.gpx
compare ${TMPDIR}/igc.gpx ${REFERENCE}/igc2_gpx.out
#
# Google Maps XML test
#
rm -f ${TMPDIR}/google.out
${PNAME} -i google -f ${REFERENCE}/google.xml -o csv -F ${TMPDIR}/google.out
compare ${TMPDIR}/google.out ${REFERENCE}/google.csv
rm -f ${TMPDIR}/google.out
${PNAME} -i google -f ${REFERENCE}/google.js -o csv -F ${TMPDIR}/google.out
compare ${TMPDIR}/google.out ${REFERENCE}/google.csv
rm -f ${TMPDIR}/google.out
${PNAME} -i google -f ${REFERENCE}/google_jan_06.html -o csv -F ${TMPDIR}/google.out
compare ${TMPDIR}/google.out ${REFERENCE}/google_jan_06.csv
#
# DeLorme .an1 tests
#
rm -f ${TMPDIR}/an1.out
${PNAME} -i an1 -f ${REFERENCE}/foo.an1 -o csv -F ${TMPDIR}/an1.out
compare ${TMPDIR}/an1.out ${REFERENCE}/an1-in.ref
rm -f ${TMPDIR}/an1.out
${PNAME} -i an1 -f ${REFERENCE}/foo.an1 -o an1 -F ${TMPDIR}/an1.out
bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-an1.ref
rm -f ${TMPDIR}/an1.out
${PNAME} -i xmap -f ${REFERENCE}/xmap -o an1 -F ${TMPDIR}/an1.out
bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-out.ref
rm -f ${TMPDIR}/an1.out
${PNAME} -i google -f ${REFERENCE}/google.js -o an1 -F ${TMPDIR}/an1.out
bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-line-out.ref
#
# TomTom .ov2 tests
#
rm -f ${TMPDIR}/ov2.out
${PNAME} -i arc -f ${REFERENCE}/google.arc -o tomtom -F ${TMPDIR}/ov2.out
compare ${TMPDIR}/ov2.out ${REFERENCE}/ov2-arc-out.ref
rm -f ${TMPDIR}/ov2.out
${PNAME} -i geo -f ${REFERENCE}/gl.loc -o tomtom -F ${TMPDIR}/ov2.out
compare ${TMPDIR}/ov2.out ${REFERENCE}/ov2-geo-out.ref
rm -f ${TMPDIR}/ov2.out
${PNAME} -i tomtom -f ${REFERENCE}/ov2-geo-out.ref -o gpsutil -F ${TMPDIR}/ov2.out
compare ${TMPDIR}/ov2.out ${REFERENCE}/ov2-in.ref
#
# XCSV "human readable" tests
#
rm -f ${TMPDIR}/humanread.out
${PNAME} -i xcsv,style=${REFERENCE}/humanread.style -f ${REFERENCE}/human.in -o arc -F ${TMPDIR}/humanread.out
compare ${TMPDIR}/humanread.out ${REFERENCE}/humanread.out
rm -f ${TMPDIR}/humanwrite.out
${PNAME} -i xcsv,style=${REFERENCE}/humanread.style -f ${REFERENCE}/human.in -o xcsv,style=${REFERENCE}/humanwrite.style -F ${TMPDIR}/humanwrite.out
compare ${TMPDIR}/humanwrite.out ${REFERENCE}/humanwrite.out
#
# XCSV "path distance" test
#
rm -f ${TMPDIR}/pathdist.out
${PNAME} -i magellan -f ${REFERENCE}/dusky.trk -o xcsv,style=${REFERENCE}/gnuplot.style -F ${TMPDIR}/pathdist.out
compare ${TMPDIR}/pathdist.out ${REFERENCE}/dusky.gnuplot
# hsandv
rm -f ${TMPDIR}/hsandv.exp ${TMPDIR}/1.exp ${TMPDIR}/1.exp ${TMPDIR}/Glad_5.exp
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o hsandv -F ${TMPDIR}/hsandv.exp
compare ${TMPDIR}/hsandv.exp ${REFERENCE}
#the hsandv format is too lossy to do this test :(
#${PNAME} -i hsandv -f ${TMPDIR}/hsandv.exp -o geo -F ${TMPDIR}/1.exp
#${PNAME} -i hsandv -f ${REFERENCE}/hsandv.exp -o geo -F ${TMPDIR}/2.exp
#compare ${TMPDIR}/1.exp ${TMPDIR}/2.exp
#test conversion from v4 to v5 files
${PNAME} -i hsandv -f ${REFERENCE}/Glad_4.exp -o hsandv -F ${TMPDIR}/Glad_5.exp
# FIXME: Can't compare directly because of potential FP rounding.
# FIXME: compare ${TMPDIR}/Glad_5.exp reference
#
# stack filter tests
# These don't actually test for proper behavior, for now, but they do
# exercise all of the currently-extant filter code.
#
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -x stack,push,copy,nowarn -x stack,push,copy -x stack,push -x stack,pop,replace -x stack,pop,append -x stack,push,copy -x stack,pop,discard -x stack,swap,depth=1 -o arc -F ${TMPDIR}/stackfilt.txt
#
# 'tabsep' isn't really tested in any non-trivial way, but we do exercise
# it.
#
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o tabsep -F ${TMPDIR}/tabsep.in
${PNAME} -i tabsep -f ${TMPDIR}/tabsep.in -o geo -F ${TMPDIR}/tabsep.out
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o geo -F ${TMPDIR}/geotabsep.out
compare ${TMPDIR}/tabsep.out ${TMPDIR}/geotabsep.out
#
# Now do the same for custom - it has the same issues.
#
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o custom -F ${TMPDIR}/custom.in
${PNAME} -i custom -f ${TMPDIR}/custom.in -o geo -F ${TMPDIR}/custom.out
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o geo -F ${TMPDIR}/geocustom.out
#
# Write something to the various output-only formats
#
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o text -F ${TMPDIR}/text.out -o html -F ${TMPDIR}/html.out -o vcard -F ${TMPDIR}/vcard.out #-o palmdoc -F ${TMPDIR}/pd.out
#
# tef "TourExchangeFormat" read test
#
rm -f ${TMPDIR}/tef_xml*
${PNAME} -r -i tef -f ${REFERENCE}/route/tef_xml.sample.xml -o gpx -F ${TMPDIR}/tef_xml.sample.gpx
compare ${TMPDIR}/tef_xml.sample.gpx ${REFERENCE}/route/tef_xml.sample.gpx
#
# PathAway Palm Database .pdb tests
#
rm -f ${TMPDIR}/pathaway*
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o pathaway,dbname="pathaway-geo" -F ${TMPDIR}/pathaway-geo.pdb
${PNAME} -i pathaway -f ${TMPDIR}/pathaway-geo.pdb -o geo -F ${TMPDIR}/pathaway-geo.loc
compare ${TMPDIR}/pathaway-geo.loc ${REFERENCE}/pathaway-geo.loc
rm -f ${TMPDIR}/pathaway*
${PNAME} -t -i pathaway -f ${REFERENCE}/track/pathaway.pdb -o gpx -F ${TMPDIR}/pathaway.gpx
compare ${TMPDIR}/pathaway.gpx ${REFERENCE}/track/pathaway.gpx
#
# Garmin GPS Database .gdb tests
#
rm -f ${TMPDIR}/gdb-*
${PNAME} -i gdb,via -f ${REFERENCE}/gdb-sample.gdb -o gpx -F ${TMPDIR}/gdb-sample.gpx
compare ${REFERENCE}/gdb-sample.gpx ${TMPDIR}/gdb-sample.gpx
${PNAME} -i gpx -f ${REFERENCE}/gdb-sample.gpx -o gdb,ver=1 -F ${TMPDIR}/gdb-sample.gdb
${PNAME} -i gdb -f ${TMPDIR}/gdb-sample.gdb -o gpx -F ${TMPDIR}/gdb-sample.gpx
#
# Because of Garmin coordinates storage gpx is not good for this test
# compare ${REFERENCE}/gdb-sample.gpx ${TMPDIR}/gdb-sample.gpx
#
# compare ${TMPDIR}/gdb-sample.gpx ${REFERENCE}/gdb-sample.gpx
#
# Vito Navigator II .smt tests
#
rm -f ${TMPDIR}/vitosmt*
${PNAME} -i vitosmt -f ${REFERENCE}/vitosmt.smt -o gpx -F ${TMPDIR}/vitosmt.gpx
compare ${TMPDIR}/vitosmt.gpx ${REFERENCE}/vitosmt.gpx
${PNAME} -t -i vitosmt -f ${REFERENCE}/vitosmt.smt -o gpx -F ${TMPDIR}/vitosmt_t.gpx
compare ${TMPDIR}/vitosmt_t.gpx ${REFERENCE}/track/vitosmt_t.gpx
#
# tracks filter tests
#
rm -f ${TMPDIR}/trackfilter*
${PNAME} -t -i gpx -f ${REFERENCE}/track/trackfilter.gpx -x track,pack,split,title="LOG-%Y%m%d" -o gpx -F ${TMPDIR}/trackfilter.gpx
compare ${TMPDIR}/trackfilter.gpx ${REFERENCE}/track/trackfilter.gpx
${PNAME} -t -i gpx -f ${REFERENCE}/track/trackfilter.gpx -x track,pack,split,sdistance=0.1k -o gpx -F ${TMPDIR}/trackfilter2.gpx
compare ${TMPDIR}/trackfilter2.gpx ${REFERENCE}/track/trackfilter-sdistance.gpx
${PNAME} -t -i gpx -f ${REFERENCE}/track/trackfilter.gpx -x track,pack,sdistance=0.1k,split=5m,title=%Y%m%d -o gpx -F ${TMPDIR}/trackfilter-sdistance2.gpx
compare ${TMPDIR}/trackfilter-sdistance2.gpx ${REFERENCE}/track/trackfilter-sdistance2.gpx
#
# Map&Guide Motorrad Routenplaner .bcr files test
#
rm -f ${TMPDIR}/bcr*
${PNAME} -r -i bcr -f ${REFERENCE}/route/bcr-sample.bcr -o gpx -F ${TMPDIR}/bcr-sample.gpx
compare ${TMPDIR}/bcr-sample.gpx ${REFERENCE}/route/bcr-sample.gpx
${PNAME} -r -i gpx -f ${REFERENCE}/route/bcr-sample.gpx -o bcr -F ${TMPDIR}/bcr-sample2.bcr
compare ${REFERENCE}/route/bcr-sample2.bcr ${TMPDIR}/bcr-sample2.bcr
${PNAME} -r -i bcr -f ${TMPDIR}/bcr-sample2.bcr -o gpx -F ${TMPDIR}/bcr-sample2.gpx
compare ${REFERENCE}/route/bcr-sample.gpx ${TMPDIR}/bcr-sample2.gpx
#
# cet - Character encoding transformation tests
#
rm -f ${TMPDIR}/cet-sample*
${PNAME} -w -i gdb -f ${REFERENCE}/cet/cet-sample.gdb -o gpx -F ${TMPDIR}/cet-sample.gpx
compare ${TMPDIR}/cet-sample.gpx ${REFERENCE}/cet/cet-sample.gpx
${PNAME} -w -i gpx -f ${TMPDIR}/cet-sample.gpx -o tmpro -c Latin1 -F ${TMPDIR}/cet-sample.latin1.txt
compare ${TMPDIR}/cet-sample.latin1.txt ${REFERENCE}/cet/cet-sample.latin1.txt
${PNAME} -w -i gdb -f ${REFERENCE}/cet/cet-sample.gdb -o tmpro -c Latin2 -F ${TMPDIR}/cet-sample.latin2.txt
compare ${TMPDIR}/cet-sample.latin2.txt ${REFERENCE}/cet/cet-sample.latin2.txt
${PNAME} -w -i gdb -f ${REFERENCE}/cet/cet-sample.gdb -o tmpro -c cp1250 -F ${TMPDIR}/cet-sample.cp1250.txt
compare ${TMPDIR}/cet-sample.cp1250.txt ${REFERENCE}/cet/cet-sample.cp1250.txt
${PNAME} -w -i gdb -f ${REFERENCE}/cet/cet-sample.gdb -o tmpro -c macroman -F ${TMPDIR}/cet-sample.macroman.txt
compare ${TMPDIR}/cet-sample.macroman.txt ${REFERENCE}/cet/cet-sample.macroman.txt
#
# Garmin logbook. This format has an extra section (lap data with things
# like heartbeat and calories burned) that we don't know what to do with,
# so we convert it to gpx, convert it to itself, convert THAT to gpx, and
# compare those.
#
rm -f ${TMPDIR}/glogbook*
${PNAME} -i glogbook -f ${REFERENCE}/track/garmin_logbook.xml -o gpx -F ${TMPDIR}/glog1.gpx
${PNAME} -i glogbook -f ${REFERENCE}/track/garmin_logbook.xml -o glogbook -F ${TMPDIR}/glog.xml
${PNAME} -i glogbook -f ${TMPDIR}/glog.xml -o gpx -F ${TMPDIR}/glog2.gpx
compare ${TMPDIR}/glog1.gpx ${TMPDIR}/glog2.gpx
#
# Dop filter test
#
rm -f ${TMPDIR}/dop*
sed '/<hdop>50/d' ${REFERENCE}/dop-test.gpx | ${PNAME} -i gpx -f - -o openoffice -F - | sed 's/RPT...//g' > ${TMPDIR}/dop-hdop.ref
${PNAME} -i gpx -f ${REFERENCE}/dop-test.gpx -x discard,hdop=50 -o openoffice -F - | sed 's/RPT...//g' > ${TMPDIR}/dop-hdop.fil
compare ${TMPDIR}/dop-hdop.ref ${TMPDIR}/dop-hdop.fil
sed '/<vdop>50/d' ${REFERENCE}/dop-test.gpx | ${PNAME} -i gpx -f - -o openoffice -F - | sed 's/RPT...//g' > ${TMPDIR}/dop-vdop.ref
${PNAME} -i gpx -f ${REFERENCE}/dop-test.gpx -x discard,vdop=50 -o openoffice -F - | sed 's/RPT...//g' > ${TMPDIR}/dop-vdop.fil
compare ${TMPDIR}/dop-vdop.ref ${TMPDIR}/dop-vdop.fil
#
# cotoGPS tests
#
rm -f ${TMPDIR}/coto*
# Track reading
${PNAME} -i coto -f ${REFERENCE}/cototesttrack.pdb -o xcsv,style=${REFERENCE}/cototest.style -F ${TMPDIR}/cototrack.csv
compare ${REFERENCE}/cototesttrack.csv ${TMPDIR}/cototrack.csv
# Marker read
${PNAME} -i coto -f ${REFERENCE}/cototestmarker.pdb -o gpx -F ${TMPDIR}/cotomarker.gpx
compare ${REFERENCE}/cototestmarker.gpx ${TMPDIR}/cotomarker.gpx
# Marker write
${PNAME} -i gpx -f ${REFERENCE}/cototestmarker.gpx -o coto -F ${TMPDIR}/cotomarker.pdb
# bincompare ${REFERENCE}/cototestmarker.pdb ${TMPDIR}/cotomarker.pdb
${PNAME} -i coto -f ${TMPDIR}/cotomarker.pdb -o gpx -F ${TMPDIR}/cotomarker.gpx
compare ${REFERENCE}/cototestmarker.gpx ${TMPDIR}/cotomarker.gpx
#
# Fugawi test cases
rm -f ${TMPDIR}/fugawi*
${PNAME} -i fugawi -f ${REFERENCE}/fugawi.notime.txt -o fugawi -F ${TMPDIR}/fugawi1.txt
compare ${REFERENCE}/fugawi.ref.txt ${TMPDIR}/fugawi1.txt
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o fugawi -F ${TMPDIR}/fugawi2.txt
compare ${REFERENCE}/fugawi.ref.txt ${TMPDIR}/fugawi2.txt
${PNAME} -i fugawi -f ${TMPDIR}/fugawi2.txt -o fugawi -F ${TMPDIR}/fugawi3.txt
compare ${TMPDIR}/fugawi2.txt ${TMPDIR}/fugawi3.txt
${PNAME} -i fugawi -f ${REFERENCE}/fugawi.time.txt -o fugawi -F ${TMPDIR}/fugawi4.txt
compare ${REFERENCE}/fugawi.time.ref.txt ${TMPDIR}/fugawi4.txt
${PNAME} -i gpx -f ${REFERENCE}/track/tracks.gpx -o fugawi -F ${TMPDIR}/fugawi5.txt
compare ${REFERENCE}/track/fugawi.txt ${TMPDIR}/fugawi5.txt
#
# Magellan Explorist geocaching format (write-only).
#
${PNAME} -i gpx -f ${REFERENCE}/gc/GC7FA4.gpx -f ${REFERENCE}/gc/GCGCA8.gpx -o maggeo -F ${TMPDIR}/maggeo.gs
compare ${REFERENCE}/gc/maggeo.gs ${TMPDIR}/maggeo.gs
#
# IGN Rando tests
#
${PNAME} -i ignrando -f ${REFERENCE}/track/ignrando-sample.rdn -o ignrando -F ${TMPDIR}/ignrando-sample.rdn
${PNAME} -i ignrando -f ${TMPDIR}/ignrando-sample.rdn -o gpx -F ${TMPDIR}/ignrando-sample.gpx
compare ${TMPDIR}/ignrando-sample.gpx ${REFERENCE}/track/ignrando-sample.gpx
#
# STMwpp "Suunto Trek Manager" WaypointPlus format tests
#
rm -f ${TMPDIR}/stmwpp-*
${PNAME} -i stmwpp -f ${REFERENCE}/track/stmwpp-track.txt -o gpx -F ${TMPDIR}/stmwpp-track.gpx
compare ${TMPDIR}/stmwpp-track.gpx ${REFERENCE}/track/stmwpp-track.gpx
${PNAME} -i stmwpp -f ${REFERENCE}/route/stmwpp-route.txt -o gpx -F ${TMPDIR}/stmwpp-route.gpx
compare ${TMPDIR}/stmwpp-route.gpx ${REFERENCE}/route/stmwpp-route.gpx
${PNAME} -i stmwpp -f ${REFERENCE}/route/stmwpp-route.txt -o stmwpp -F ${TMPDIR}/stmwpp-route.txt
compare ${TMPDIR}/stmwpp-route.txt ${REFERENCE}/route/stmwpp-route.txt
#
# Microsoft AutoRoute 2002 test (read-only)
#
${PNAME} -i msroute -f ${REFERENCE}/route/msroute-sample.axe -o gpx -F ${TMPDIR}/msroute-sample.gpx
compare ${TMPDIR}/msroute-sample.gpx ${REFERENCE}/route/msroute-sample.gpx
#
# CarteSurTable read test
#
rm -f ${TMPDIR}/cst-*
${PNAME} -i cst -f ${REFERENCE}/route/cst-sample.cst -o gpx -F ${TMPDIR}/cst-sample.gpx
compare ${TMPDIR}/cst-sample.gpx ${REFERENCE}/route/cst-sample.gpx
#
# Navigon Mobile Navigator .rte tests
#
rm -f ${TMPDIR}/nmn4-sample*
${PNAME} -i nmn4 -f ${REFERENCE}/route/nmn4-sample.rte -o gpx -F ${TMPDIR}/nmn4-sample.gpx
compare ${REFERENCE}/route/nmn4-sample.gpx ${TMPDIR}/nmn4-sample.gpx
${PNAME} -i gpx -f ${REFERENCE}/route/nmn4-sample.gpx -o nmn4 -F ${TMPDIR}/nmn4-sample-out.rte
compare ${REFERENCE}/route/nmn4-sample-out.rte ${TMPDIR}/nmn4-sample-out.rte
#
# Map&Guide Palm/OS .pdb files (read-only)
#
rm -f ${TMPDIR}/mag_pdb-*
${PNAME} -i mag_pdb -f ${REFERENCE}/route/mag_pdb-sample.pdb -o gpx -F ${TMPDIR}/mag_pdb-sample.gpx
compare ${TMPDIR}/mag_pdb-sample.gpx ${REFERENCE}/route/mag_pdb-sample.gpx
#
# CompeGPS I/O tests
#
rm -f ${TMPDIR}/compegps*
# read (CompeGPS)
${PNAME} -i compegps -f ${REFERENCE}/compegps.wpt -o gpx -F ${TMPDIR}/compegps-wpt.gpx
compare ${REFERENCE}/compegps-wpt.gpx ${TMPDIR}/compegps-wpt.gpx
${PNAME} -i compegps -f ${REFERENCE}/route/compegps.rte -o gpx -F ${TMPDIR}/compegps-rte.gpx
compare ${REFERENCE}/route/compegps-rte.gpx ${TMPDIR}/compegps-rte.gpx
${PNAME} -i compegps -f ${REFERENCE}/track/compegps.trk -o gpx -F ${TMPDIR}/compegps-trk.gpx
compare ${REFERENCE}/track/compegps-trk.gpx ${TMPDIR}/compegps-trk.gpx
# write (CompeGPS)
${PNAME} -i compegps -f ${REFERENCE}/compegps.wpt -o compegps -F ${TMPDIR}/compegps.wpt
${PNAME} -i compegps -f ${TMPDIR}/compegps.wpt -o gpx -F ${TMPDIR}/compegps-wpt2.gpx
compare ${REFERENCE}/compegps-wpt.gpx ${TMPDIR}/compegps-wpt2.gpx
${PNAME} -t -i compegps -f ${REFERENCE}/track/compegps.trk -o compegps -F ${TMPDIR}/compegps.trk
${PNAME} -i compegps -f ${TMPDIR}/compegps.trk -o gpx -F ${TMPDIR}/compegps-trk2.gpx
compare ${REFERENCE}/track/compegps-trk.gpx ${TMPDIR}/compegps-trk2.gpx
${PNAME} -r -i compegps -f ${REFERENCE}/route/compegps.rte -o compegps -F ${TMPDIR}/compegps.rte
${PNAME} -i compegps -f ${TMPDIR}/compegps.rte -o gpx -F ${TMPDIR}/compegps-rte2.gpx
compare ${REFERENCE}/route/compegps-rte.gpx ${TMPDIR}/compegps-rte2.gpx
#
# Testing the 'nuketypes' filter is funky.
# Convert a GPX file to GPX to eliminate jitter.
# Then nuke the all but the three individual types, merge the result together
# and verify we got the original back.
#
${PNAME} -i gpx -f ${REFERENCE}/gdb-sample.gpx -o gpx -F ${TMPDIR}/alltypes.gpx
${PNAME} -i gpx -f ${TMPDIR}/alltypes.gpx -x nuketypes,tracks,routes -o gpx -F ${TMPDIR}/wpts.gpx
${PNAME} -i gpx -f ${TMPDIR}/alltypes.gpx -x nuketypes,waypoints,routes -o gpx -F ${TMPDIR}/trks.gpx
${PNAME} -i gpx -f ${TMPDIR}/alltypes.gpx -x nuketypes,waypoints,tracks -o gpx -F ${TMPDIR}/rtes.gpx
${PNAME} -i gpx -f ${TMPDIR}/wpts.gpx -f ${TMPDIR}/trks.gpx -f ${TMPDIR}/rtes.gpx -o gpx -F ${TMPDIR}/merged.gpx
compare ${TMPDIR}/alltypes.gpx ${TMPDIR}/merged.gpx
#
# Interpolate filter
#
${PNAME} -i gpx -f ${REFERENCE}/track/simpletrack.gpx -x interpolate,distance=50m -o gpx -F ${TMPDIR}/interp.gpx
compare ${REFERENCE}/track/interptrack.gpx ${TMPDIR}/interp.gpx
${PNAME} -i gpx -f ${REFERENCE}/track/simpletrack.gpx -x interpolate,time=1 -o gpx -F ${TMPDIR}/tinterp.gpx
compare ${REFERENCE}/track/tinterptrack.gpx ${TMPDIR}/tinterp.gpx
#
# Universal CSV - unicsv
#
echo "lat,lon,descr,name,notes,unk,unk" > ${TMPDIR}/unicsv.txt
cat ${REFERENCE}/mxf.mxf >> ${TMPDIR}/unicsv.txt
${PNAME} -i unicsv -f ${TMPDIR}/unicsv.txt -o gpx -F ${TMPDIR}/unicsv.gpx
compare ${TMPDIR}/unicsv.gpx ${REFERENCE}/unicsv.gpx
#
# Basic NMEA tests
#
${PNAME} -i nmea -f ${REFERENCE}/track/nmea -o gpx -F ${TMPDIR}/nmea.gpx
compare ${TMPDIR}/nmea.gpx ${REFERENCE}/track/nmea.gpx
#
# Wfff.
#
${PNAME} -i wfff -f ${REFERENCE}/wfff.xml -o gpsutil -F ${TMPDIR}/wfff.gpu
compare ${TMPDIR}/wfff.gpu ${REFERENCE}/wfff.gpu
#
# Garmin MapSource tab delimited text files - garmin_txt
#
rm -f ${TMPDIR}/garmin_txt*
#
# !!! garmin_txt timestamps are stored in localtime !!!
#
${PNAME} -i gdb -f ${REFERENCE}/gdb-sample2.gdb -o garmin_txt,utc,prec=9 -F ${TMPDIR}/garmin_txt.txt
compare ${REFERENCE}/garmin_txt.txt ${TMPDIR}/garmin_txt.txt
${PNAME} -i garmin_txt -f ${REFERENCE}/garmin_txt.txt -o garmin_txt,prec=9 -F ${TMPDIR}/garmin_txt-2.txt
${PNAME} -i garmin_txt -f ${TMPDIR}/garmin_txt-2.txt -o garmin_txt,prec=9 -F ${TMPDIR}/garmin_txt-3.txt
#
# test can fail because of localtime/gmtime differences
#
## compare ${TMPDIR}/garmin_txt-2.txt ${TMPDIR}/garmin_txt-3.txt
#
# hiketech tests
#
rm -f ${TMPDIR}/hiketech*
${PNAME} -i gpx -f ${REFERENCE}/expertgps.gpx -o hiketech -F ${TMPDIR}/hiketech.out
compare ${TMPDIR}/hiketech.out ${REFERENCE}/hiketech.ref
${PNAME} -i hiketech -f ${REFERENCE}/hiketech.ref -o gpx -F ${TMPDIR}/hiketech.gpx
compare ${TMPDIR}/hiketech.gpx ${REFERENCE}/hiketech.gpx
#
# Kartex waypoints and tracks
#
rm -f ${TMPDIR}/kartex*
${PNAME} -i kwf2 -f ${REFERENCE}/waypointsDd.kwf -o kwf2 -F ${TMPDIR}/kartex-1a.kwf
compare ${REFERENCE}/kartex-out.kwf ${TMPDIR}/kartex-1a.kwf
# ! different format of coords; this checks LATLON_HUMAN_READABLE !
${PNAME} -i kwf2 -f ${REFERENCE}/waypointsDMm.kwf -o kwf2 -F ${TMPDIR}/kartex-1b.kwf
compare ${TMPDIR}/kartex-1a.kwf ${TMPDIR}/kartex-1b.kwf
#
${PNAME} -i ktf2 -f ${REFERENCE}/track/trackDd.ktf -o ktf2 -F ${TMPDIR}/kartex-2a.ktf
compare ${REFERENCE}/track/kartex-out.ktf ${TMPDIR}/kartex-2a.ktf
# ! different format of coords; this checks LATLON_HUMAN_READABLE !
${PNAME} -i ktf2 -f ${REFERENCE}/track/trackDMm.ktf -o ktf2 -F ${TMPDIR}/kartex-2b.ktf
compare ${TMPDIR}/kartex-2a.ktf ${TMPDIR}/kartex-2b.ktf
#
# Dell Axim Navigation System 'axim_gpb' test
#
rm -f ${TMPDIR}/axim-*
${PNAME} -i axim_gpb -f ${REFERENCE}/track/axim-sample.gpb -o gpx -F ${TMPDIR}/axim-sample.gpx
compare ${REFERENCE}/track/axim-sample.gpx ${TMPDIR}/axim-sample.gpx
#
# Franson GPSGate simulation
#
${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o gpssim -F ${TMPDIR}/waypoints.gpssim
compare ${TMPDIR}/waypoints.gpssim ${REFERENCE}
${PNAME} -i gpx -f ${REFERENCE}/track/tracks.gpx -o gpssim -F ${TMPDIR}/tracks.gpssim
compare ${TMPDIR}/tracks.gpssim ${REFERENCE}/track
#
# WBT-200 tests
#
rm -f ${TMPDIR}/wbt-200.*
${PNAME} -i wbt-bin -f ${REFERENCE}/wbt-200.bin -o gpx -F ${TMPDIR}/wbt-200.gpx
# Remove the timestamp
grep -v time <${TMPDIR}/wbt-200.gpx >${TMPDIR}/wbt-200.gpx2
compare ${TMPDIR}/wbt-200.gpx2 ${REFERENCE}/wbt-200.gpx
#
# Sportsim style-sheet
#
rm -f ${TMPDIR}/sportsim*
${PNAME} -i gpx -f ${REFERENCE}/expertgps.gpx -x nuketypes,waypoints,routes -o sportsim -F ${TMPDIR}/sportsim.txt
compare ${TMPDIR}/sportsim.txt ${REFERENCE}/track/sportsim-sample.txt
#
# Suunto SDF
#
rm -f ${TMPDIR}/stmsdf*
${PNAME} -i garmin_txt -f ${REFERENCE}/garmin_txt.txt -t -o stmsdf -F ${TMPDIR}/stmsdf-track.sdf -r -o stmsdf,index=2 -F ${TMPDIR}/stmsdf-route.sdf
compare ${TMPDIR}/stmsdf-track.sdf ${REFERENCE}/track/stmsdf-track.sdf
compare ${TMPDIR}/stmsdf-route.sdf ${REFERENCE}/route/stmsdf-route.sdf
${PNAME} -i stmsdf -f ${TMPDIR}/stmsdf-track.sdf -f ${TMPDIR}/stmsdf-route.sdf -o garmin_txt,prec=2 -F ${TMPDIR}/stmsdf.txt
compare ${TMPDIR}/stmsdf.txt ${REFERENCE}/stmsdf.txt
#
# Digital Mapping Tracklogs
#
rm -f ${TMPDIR}/dmtlog*
${PNAME} -i gpx -f ${REFERENCE}/expertgps.gpx -o dmtlog -F ${TMPDIR}/dmtlog-sample.trl
${PNAME} -i dmtlog -f ${TMPDIR}/dmtlog-sample.trl -o gpx -F ${TMPDIR}/dmtlog-sample.gpx
compare ${TMPDIR}/dmtlog-sample.gpx ${REFERENCE}/track/dmtlog-sample.gpx
#
# gzipped file i/o
#
${PNAME} -i compegps -f ${REFERENCE}/compegps.wpt.gz -o gpx -F ${TMPDIR}/compegps-wpt.gpx
compare ${REFERENCE}/compegps-wpt.gpx ${TMPDIR}/compegps-wpt.gpx
${PNAME} -i cst -f ${REFERENCE}/route/cst-sample.cst.gz -o gpx -F ${TMPDIR}/cst-sample.gpx
compare ${TMPDIR}/cst-sample.gpx ${REFERENCE}/route/cst-sample.gpx
#
# Quick tests for Google Earth/KML format
# Note: Reference files are from GPSBabel's own output.
#
${PNAME} -i gpx -f ${REFERENCE}/gc/GC7FA4.gpx -f ${REFERENCE}/gc/GCGCA8.gpx -o kml -F ${TMPDIR}/ge-gc.kml
compare ${TMPDIR}/ge-gc.kml ${REFERENCE}/earth-gc.kml
${PNAME} -i gpx -f ${REFERENCE}/expertgps.gpx -o kml -F ${TMPDIR}/ge-eg.kml
compare ${TMPDIR}/ge-eg.kml ${REFERENCE}/earth-expertgps.kml
#
# Transformation filter (transform) tests
#
rm -f ${TMPDIR}/transform*
${PNAME} -i gpx -f ${REFERENCE}/expertgps.gpx -x nuketypes,routes,tracks -x transform,rte=wpt,del=y -o gpx -F ${TMPDIR}/transform-rte.gpx
compare ${TMPDIR}/transform-rte.gpx ${REFERENCE}/transform-rte.gpx
${PNAME} -i gpx -f ${REFERENCE}/expertgps.gpx -x nuketypes,waypoints,tracks -x transform,wpt=rte,del=y -o gpx -F ${TMPDIR}/transform-wpt.gpx
compare ${TMPDIR}/transform-wpt.gpx ${REFERENCE}/transform-wpt.gpx
exit 0
|