NAME
GPS::Lowrance::Trail - Convert between Lowrance GDM16 Trail Files
REQUIREMENTS
GPS::Lowrance::Trail
was written and tested on Perl 5.6.1, though it should work with v5.005.
It uses only standard modules.
Installation
Installation is pretty standard:
perl Makefile.PL
make
make test
make install
There is no test suite to speak of. One will be added in a later version.
SYNOPSIS
use GPS::Lowrance::Trail;
my $trail = new GPS::Lowrance::Trail;
my $fh1 = new FileHandle '<lowrance.txt';
my $fh2 = new FileHandle '>lonlat.txt';
$trail->read_gdm16( $fh1 ); # read GDM16 Trail Exports
$trail->write_lonlat( $fh2 ); # write as Longitude/Latitude file
DESCRIPTION
This module allows one to convert between Lowrance GPS trail files (handled by the GDM16 application) and Longitude/Lattitude files which may be used by mapping applications.
Methods
The following methods are implemented.
- new
-
my $trail = new GPS::Lowrance::Trail;
Generates a new instance of the object.
- trail_num
-
$trail->trail_num(1); if ($trail->trail_num() > 4) { ... }
Sets or gets the "Plot Trail" number indicated in the GDM16 trail export. GDM16 does not seem to care about this number when importing a trail.
The number should be between 1 and 4 (corresponding to what GDM16 allows) although the
GPS::Lowrance::Trail
module does not care. - add_point
-
$trail->add_point( $longitude, $latitude );
Add a point to the trail.
$longitude
and$latitude
are in decimal form. - size
-
$trail->size();
Returns the number of points on the trail.
- read_gdm16
-
my $fh = FileHandle "mytrail.txt"; $trail->read_gdm16( $fh );
Read a trail file in GDM16 format. Points are appended to the last point.
- read_lonlat
-
Read a trail file in Longitude/Latitude file format. Points are appended to the last point.
- write_gdm16
-
Write a trail file in GDM16 format.
- write_lonlat
-
Write a trail file in Longitude/Latitude format.
- errors
-
Returns a value if there were errors when reading a file.
Export
None by default.
Exporting Trail Files from GDM16
Trail data can be extracted from the GDM16 utility (which is distributed by Lowrance at http://www.lowrance.com). To do so, choose the "Trails" tab, select "Edit" and then "Copy", then open your favorite text editor and paste from the clipboard.
What you have is the file format which this Perl module processes.
Likewise, to import a trail file, open one of these files, "Select All" and "Copy" the file, load GDM16, select the "Trails" tab and choose "Edit" and "Paste".
CAVEATS
This module comes from a quick and dirty hack adapted from a one-off script written for this purpose. It appears to work, but has not been fully tested.
More features and file formats may be added in the future.
AUTHOR
Robert Rothenberg <rrwo@cpan.org>
LICENSE
Copyright (c) 2002 Robert Rothenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.