Magellan DirectRoute 3.0 Instrukcja Użytkownika Strona 34

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 130
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 33
The
For-
mats
19
XMap on the PocketPC stores its waypoints in individual .wpt files. For example, waypoints generated by
XMap on the PocketPC are stored by default in the "My Documents" folder using the sequential names
"XMap1.wpt", "XMap2.wpt", ad nauseum. Needless to say, this is not very efficient.
As writing multiple waypoint files is outside of the scope of GPSBabel, GPSBabel chooses to write one
big file, one waypoint per line. Extracting lines from this file is left as an exercise for the end user. A
simple Perl script to handle this conversion is included at the end of this chapter.
It should also be noted that reading multiple files is indeed possible, but if you have more than a few
points, it can be a task. For example:
gpsbabel -i xmapwpt -f Xmap1.wpt -f Xmap2.wpt -o mapsend -F mapsend.wpt
will read the two Xmap .wpt files and write one mapsend file. This is fine for a small handful of points,
but could be quite cumbersome for folks like me who have 100+ waypoints loaded into XMap. For *nix
folks, something as simple as:
cat *.wpt > /tmp/foo.wpt
gpsbabel -i xmapwpt -f foo.wpt -o mapsend -F mapsend.wpt
will do the trick just fine.
#!/full/path/to/perl
$INPUTFILE = @ARGV[0];
$TARGETDIR = @ARGV[1];
$FILENAME = @ARGV[2];
if (! $FILENAME) {
print "Usage: xmap_split.pl " .
"INPUT_FILE OUTPUT_DIRECTORY FILENAME_BASE\n";
print " (i.e. xmapl_split.pl points.wpt /tmp/points GPSB)\n";
print " (created GPSB0001-GPSBXXXX " .
" in /tmp/points/ from points.wpt)\n";
exit;
}
open (INFILE, $INPUTFILE) || die "Cannot open $INPUTFILE for read!\n";
while (<INFILE>) {
$lc++;
$filename = sprintf("%s/Gpsb%04d.wpt", $TARGETDIR, $lc);
open (OUTFILE, ">$filename") ||
die "Cannot open $filename for write!\n";
print OUTFILE $_;
close(OUTFILE);
}
exit;
Przeglądanie stron 33
1 2 ... 29 30 31 32 33 34 35 36 37 38 39 ... 129 130

Komentarze do niniejszej Instrukcji

Brak uwag