Geo-TCX

 view release on metacpan or  search on metacpan

lib/Geo/TCX/Interactive.pm  view on Meta::CPAN

    my $o = shift;
    my $class = ref $o;
    croak "no waypoint file loaded in $class object" unless defined $o->{gpx};
    return $o->{gpx}
}

=over 4

=item way_clip( $name | $regex | LIST )

Sends the coordinates of waypoints whose name is either C<$name> or matches C<$regex> to the clipboard (all points found are sent to the clipboard). Returns an array of points found.

By default, the regex is case-sensitive; specify C<qr/(?i:...)/> to ignore case.

Alternatively, an array of C<Geo::GXP::Points> can be supplied such that we can call C<< $o->way_clip( $o->gpx->search_desc( qr/(?i:Sunset)/ ) >>.

This method is only supported on unix-based systems that have the C<xclip> utility installed (see BUGS AND LIMITATIONS).

=back

=cut

lib/Geo/TCX/Interactive.pm  view on Meta::CPAN

            push @points, $match if $match
        }
        croak 'no point matches the supplied regex' unless @points
    }
    my @points_reversed = reverse @points;

    for my $pt (@points_reversed) {
        croak 'way_clip() expects list of Geo::Gpx::Point objects' unless $pt->isa('Geo::Gpx::Point');
        my $coords = $pt->lat . ', ';
        $coords   .= $pt->lon;
        system("echo $coords | xclip -selection clipboard")
    }
    return @points
}

=over 4

=item way_device_send()

Send the waypoints to a GPS device, overwriting any existing file. The device must be plugged in.



( run in 0.793 second using v1.01-cache-2.11-cpan-2398b32b56e )