| 1 |
|
| 2 |
NOTE: THIS README PERTAINS TO THE "XMAPWPT" FORMAT, NOT THE XMAP/TOPO USA |
| 3 |
4.0 CONDUIT "XMAP" FORMAT. |
| 4 |
|
| 5 |
|
| 6 |
Delorme XMap Handheld .WPT for PocketPC is a bit of a kludge. This |
| 7 |
document covers XMap Handheld Street Atlas USA edition. |
| 8 |
|
| 9 |
XMap on the PocketPC stores it's waypoints in individual .wpt files. |
| 10 |
For example, waypoints generated by XMap on the PocketPC are stored |
| 11 |
by default in the "My Documents" folder using the sequential names |
| 12 |
"XMap1.wpt", "XMap2.wpt", ad nauseum. Needless to say, not very |
| 13 |
efficient. |
| 14 |
|
| 15 |
As writing multiple waypoint files is outside of the scope of gpsbabel, |
| 16 |
gpsbabel chooses to write one big file, one waypoint per line. |
| 17 |
Extracting lines from this file is left as an exercise for the end user. |
| 18 |
A simple perl script to handle this conversion is included at the end |
| 19 |
of this README. |
| 20 |
|
| 21 |
It should also be noted that READING multiple files is indeed possible, |
| 22 |
but if you have more than a few points, it can be a task. For example: |
| 23 |
|
| 24 |
gpsbabel -i xmapwpt -f Xmap1.wpt -f Xmap2.wpt -o mapsend -F mapsend.wpt |
| 25 |
|
| 26 |
will read the two Xmap .wpt files and write one mapsend file. This |
| 27 |
is fine for a small handful of points, but could be quite cumbersome |
| 28 |
for folks like me who have 100+ waypoints loaded into XMap. For *nix |
| 29 |
folks, something as simple as: |
| 30 |
|
| 31 |
cat *.wpt > /tmp/foo.wpt |
| 32 |
gpsbabel -i xmapwpt -f foo.wpt -o mapsend -F mapsend.wpt |
| 33 |
|
| 34 |
will do the trick just fine. |
| 35 |
|
| 36 |
|
| 37 |
############ BEGIN SCRIPT |
| 38 |
#!/full/path/to/perl |
| 39 |
$INPUTFILE = @ARGV[0]; |
| 40 |
$TARGETDIR = @ARGV[1]; |
| 41 |
$FILENAME = @ARGV[2]; |
| 42 |
|
| 43 |
if (! $FILENAME) { |
| 44 |
print "Usage: xmap_split.pl INPUT_FILE OUTPUT_DIRECTORY FILENAME_BASE\n"; |
| 45 |
print " (i.e. xmapl_split.pl points.wpt /tmp/points GPSB)\n"; |
| 46 |
print " (created GPSB0001-GPSBXXXX in /tmp/points/ from points.wpt)\n"; |
| 47 |
exit; |
| 48 |
} |
| 49 |
|
| 50 |
open (INFILE, $INPUTFILE) || die "Cannot open $INPUTFILE for read!\n"; |
| 51 |
|
| 52 |
while (<INFILE>) { |
| 53 |
$lc++; |
| 54 |
$filename = sprintf("%s/Gpsb%04d.wpt", $TARGETDIR, $lc); |
| 55 |
|
| 56 |
open (OUTFILE, ">$filename") || die "Cannot open $filename for write!\n"; |
| 57 |
|
| 58 |
print OUTFILE $_; |
| 59 |
|
| 60 |
close(OUTFILE); |
| 61 |
} |
| 62 |
|
| 63 |
exit; |
| 64 |
|
| 65 |
########### END SCRIPT |
| 66 |
|