The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Geo::Cache - Object interface for GPS waypoints

SYNOPSIS

    use Geo::Cache;
    my $wpt = Geo::Cache->new(
        lat  => '37.99815',
        lon  => '-85.302017',
        time => $time,
        name => 'GCGVW8',
        desc => 'Neither Hill nor Dale',
        sym  => 'geocache',
        type => 'Geocache|Traditional Cache',
    );
    $wpt->url('http://www.geocaching.com/');


    my $wpt_from_xml = Geo::Cache->new( xml => $xml, );

    my $xml = $wpt->xml;

DESCRIPTION

Provide an object interface to Geocaching.com waypoints and/or geocaches, using the Groundspeak GPX file as the reference for what fields are valid.

Methods are provide for various of the fields that require special treatment.

Three output methods are provided -- gpx, gpsdrive, and loc, for outputting a single waypoint in one of these three formats. These can be used in conjunction with the Geo::Gpx module to produce files of those formats.

AUTHOR

        Rich Bowen
        rbowen@rcbowen.com

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

new

Create a new Geo::Cache object.

    my $wpt = Geo::Cache->new(
        lat  => '37.99815',
        lon  => '-85.302017',
        time => $time,
        name => 'GCGVW8',
        desc => 'Neither Hill nor Dale',
        sym  => 'geocache',
        type => 'Geocache|Traditional Cache',
    );

Data methods

A data method is provided for each of the valid fields within a Cache object. Calling the method with no argument returns the value of that attribute. Calling the method with an argument changes the value of that attribute to that value.

 my $name = $cache->name;
 $cache->lon(-84.8934);

xml/gpx

Returns a blob of XML which constitutes one <wpt> block of a Geocaching.com-style gpx data file. You'll generally not use this method by itself, but will call the gpx method from the Geo::Gpx module to generate the entire file of one or more waypoints.

xml is an alias for the gpx method.