Algorithm::GooglePolylineEncoding - Google's Encoded Polyline Algorithm Format
use Algorithm::GooglePolylineEncoding; @polyline = ({lat => 52.5, lon => 13.4}, ...); $encoded_polyline = Algorithm::GooglePolylineEncoding::encode_polyline(@polyline);
Algorithm::GooglePolylineEncoding implements the encoded polyline algorithm format which is used in some parts of the Google Maps API. The algorithm is described in https://developers.google.com/maps/documentation/utilities/polylinealgorithm.
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.
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).
{lat => ..., lon => ...}
Return an encoded level.
Return just an encoded number (which may be a single longitude, or latitude, or delta).
Take an encoded polyline string and return a list of {lat => ..., lon => ...} hashrefs.
Slaven Rezic <srezic@cpan.org>
Copyright (c) 2009,2010,2012,2017,2018 Slaven Rezic. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Geo::Google::PolylineEncoder
To install Algorithm::GooglePolylineEncoding, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::GooglePolylineEncoding
CPAN shell
perl -MCPAN -e shell install Algorithm::GooglePolylineEncoding
For more information on module installation, please visit the detailed CPAN module installation guide.