Skip to content
Easily handle Google polylines
Ruby
Failed to load latest commit information.
lib
spec
.gitignore Initial Jan 30, 2011
Gemfile
Gemfile.lock Bump version to 0.3.0 Jun 8, 2015
LICENSE
README.markdown Be public-friendly Feb 19, 2011
Rakefile
polylines.gemspec Add rake to dev dependency for travis Nov 30, 2012

README.markdown

Polylines

Easily handle Google polylines

Install

Install with Rubygems:

gem install polylines

Usage

To encode an array of latitude/longitude pairs:

>> Polylines::Encoder.encode_points([[38.5, -120.2], [40.7, -120.95], [43.252, -126.453]])
=> "_p~iF~ps|U_ulLnnqC_mqNvxq`@"

To decode a polyline into an array of latitude/longitude pairs:

>> Polylines::Decoder.decode_polyline("_p~iF~ps|U_ulLnnqC_mqNvxq`@")
=> [[38.5, -120.2], [40.7, -120.95], [43.252, -126.453]]

I wrote this to follow the steps outlined in http://code.google.com/apis/maps/documentation/utilities/polylinealgorithm.html.

License

Please see LICENSE

Author

Written by Josh Clayton

Something went wrong with that request. Please try again.