Algorithm::GooglePolylineEncoding - Encode and Decode lat/lon polygons using Google Maps string encoding.
use Algorithm::GooglePolylineEncoding;
my $encoded = encode-polyline( { :lat(90), :lon(90) }, { :lat(0), :lon(0) }, { :lat(22.5678), :lon(45.2394) } );
my @polyline = deocde-polyline( $encoded );
Algorithm::GooglePolylineEncoding is intended to be used to encoded and decode Google Map polylines.
Note this is a lossy encoded, any decimal values beyond the 5th place in a latitude of longitude will be lost.
Encodes a polyline list (supplied in any of the listed formats) and returns a Str of the encoded data.
Takes a string encoded using the algorithm and returns an Array of Hashes with lat / lon keys.
For further details on the encoding algorithm please see the follow link:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm
Simon Proctor [email protected]
Copyright 2018 Simon Proctor
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.