Algorithm::GooglePolylineEncoding - Google's Encoded Polyline Algorithm Format


Algorithm-GooglePolylineEncoding documentation  | view source Contained in the Algorithm-GooglePolylineEncoding distribution.

Index


NAME

Top

Algorithm::GooglePolylineEncoding - Google's Encoded Polyline Algorithm Format

SYNOPSIS

Top

    use Algorithm::GooglePolylineEncoding;
    @polyline = ({lat => 52.5, lon => 13.4}, ...);
    $encoded_polyline = Algorithm::GooglePolylineEncoding::encode_polyline(@polyline);

DESCRIPTION

Top

Algorithm::GooglePolylineEncoding implements the encoded polyline algorithm format which is used in some parts of the Google Maps API. The algorithm is described in http://code.google.com/intl/en/apis/maps/documentation/polylinealgorithm.html.

This module is a light-weight version of Geo::Google::PolylineEncoder, essentially just doing the encoding part without any line simplification, and implemented without any CPAN dependencies.

FUNCTIONS

encode_polyline(@polyline)

Take an array of {lat => ..., lon => ...} hashrefs and return an encoded polyline string. Latitudes and longitudes should be expressed as decimal degrees (DD; http://en.wikipedia.org/wiki/Decimal_degrees).

encode_level($level)

Return an encoded level.

encode_number($number)

Return just an encoded number (which may be a single longitude, or latitude, or delta).

decode_polyline($encoded)

Take an encoded polyline string and return a list of {lat => ..., lon => ...} hashrefs.

AUTHOR

Top

Slaven Rezic <srezic@cpan.org>

COPYRIGHT

Top

SEE ALSO

Top

Geo::Google::PolylineEncoder


Algorithm-GooglePolylineEncoding documentation  | view source Contained in the Algorithm-GooglePolylineEncoding distribution.