Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

GPS::Lowrance::Trail
Convert between GDM16 Trails and other formats

GPS::Lowrance::Trail - Convert between GDM16 Trails and other formats


REQUIREMENTS

The following non-standard modules are used:


  Carp::Assert

  Geo::Coordinates::UTM

  XML::Generator

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_latlon( $fh2 );    # write as Longitude/Latitude file


DESCRIPTION

This module allows one to convert between Lowrance GPS trail files (handled by their GDM16 application), Latitude/Longitude (or ``Lat/Lon'') files, UTM, and GPX files which may be used by mapping applications.

Methods

The following methods are implemented.

new

  $trail = new GPS::Lowrance::Trail;

Generates a new instance of the object.

As of v0.41, optional configuration parameters can be added:


  $trail = new GPS::Lowrance::Trail(

    trail_num => 2,

    rounding  => 0,

    read_utm  => $fh,

    datum     => 23,

  );

The trail_num and rounding parameters can be configured. Also, the read methods can be specified to read a file.

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( $latitude, $longitude, $name, $date );

Add a point to the trail.

$latitude and $longitude are in decimal degrees form. $name and $date are optional.

$date is the native Perl (Unix) time.

size

  $trail->size();

Returns the number of points on the trail.

get_trail

  my $array_ref = $trail->get_trail;

Returns a reference to an array of all trail points (where each point is an array reference to the latitude and longitude).

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_latlon

  $trail->read_latlon( $fh );

Read a trail file in Latitude/Longitude file format. Points are appended to the last point.

datum

  $trail->datum(23);

  $datum = $trail->datum;

Accessor for the datum value used by the read_utm and write_utm methods. See the Geo::Coordinates::UTM manpage for values.

read_utm

  $trail->read_utm( $fh );

Read a trail file in UTM file format. Points are appended to the last point.

rounding

  $trail->rounding(0);

  if ($trail->rounding) { ... }

Controls the decimal rounding setting for output. (Default is 1). If this is set, output for write_latlon and write_utm methods is rounded off.

The setting is ignored by write_gdm16 and write_gpx methods.

write_gdm16

  $trail->write_gdm16( $fh );

Write a trail file in GDM16 format.

write_latlon

  $trail->write_latlon( $fh );

Write a trail file in Longitude/Latitude format.

write_utm

  $trail->write_utm( $fh );

Write a tail file in UTM (Universal Tranverse Mercator) format. Assumes WGS-84 datum.

write_gpx

  $trail->write_gpx( $fh );

Writes a trail file in TopoGrafix GPX format.

errors
Returns a value if there were errors when reading a file.

Exporting Trail Files from GDM16

Trail data can be extracted from the GDM16 utility (which is distributed by Lowrance at http://www.lowrance.com) or Eagle at http://www.eaglegps.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''.


SEE ALSO

the GPS::Lowrance manpage implements higher-level functions to extract trails and other information directly from the GPS device. It uses this module.

the Geo::GPS::Data manpage is a GPS data management module. However, it does not yet implement track logs. When it does, this module may be modified to interface with it.

the Location::GeoTool manpage will convert coordinates to different formats and across different datums.

There is an open source application called GPSBabel http://gpsbabel.sourceforge.net which aims to convert between various GPS trail and waypoint formats, as well as do various forms of processing on the data.

Information on TopoGrafix GPS format is available at http://www.topografix.com/gpx.asp.


AUTHOR

Robert Rothenberg <rrwo at cpan.org>

Suggestions and Bug Reporting

Feedback is always welcome. Please report any bugs using the CPAN Request Tracker at http://rt.cpan.org.


COPYRIGHT AND LICENSE

Copyright (C) 2002,2004 by Robert Rothenberg <rrwo at cpan.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy