Geo-Gpx

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

        $pt = Geo::Gpx::Point->new( %point );
        $gpx->waypoints_add( $pt );

- waypoints\_search( $field => $regex )

    returns an array of waypoints whose _$field_ (e.g. `name`, `desc`, …) matches _$regex_. By default, the regex is case-sensitive; specify `qr/(?i:search_string_here)/` to ignore case.

- waypoints\_clip( $name | $regex | LIST )
- way\_clip( )

    Sends the coordinates of the waypoint(s) whose name is either `$name` or matches `$regex` to the clipboard (all points found are sent to the clipboard) and returns an array of points found. By default, the regex is case-sensitive; specify `qr/(?i...

    Alternatively, an array of `Geo::GXP::Points` can be provided. `way_clip()` is a short-hand for this method (convenient when used interactively in the debugger).

    This method is only supported on unix-based systems that have the `xclip` utility installed (see DEPENDENCIES).

- waypoints\_delete\_all()

    delete all waypoints. Returns true.

- waypoint\_delete( $name )

lib/Geo/Gpx.pm  view on Meta::CPAN

    }
    return @matches
}

=over 4

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

=item way_clip( )

Sends the coordinates of the waypoint(s) whose name is either C<$name> or matches C<$regex> to the clipboard (all points found are sent to the clipboard) and returns an array of points found. By default, the regex is case-sensitive; specify C<qr/(?i:...

Alternatively, an array of C<Geo::GXP::Points> can be provided. C<way_clip()> is a short-hand for this method (convenient when used interactively in the debugger).

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

=back

=cut

sub way_clip { waypoints_clip( @_ ) }

lib/Geo/Gpx.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 waypoints_delete_all()

delete all waypoints. Returns true.



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