Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshuaclayton/polylines
Easily handle Google polylines
https://github.com/joshuaclayton/polylines
Last synced: about 1 month ago
JSON representation
Easily handle Google polylines
- Host: GitHub
- URL: https://github.com/joshuaclayton/polylines
- Owner: joshuaclayton
- License: mit
- Created: 2011-02-19T14:25:18.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2020-12-05T06:59:07.000Z (almost 4 years ago)
- Last Synced: 2024-06-03T22:51:19.705Z (4 months ago)
- Language: Ruby
- Homepage:
- Size: 20.5 KB
- Stars: 93
- Watchers: 6
- Forks: 17
- Open Issues: 2
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# 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