{"id":13564269,"url":"https://github.com/urschrei/pypolyline","last_synced_at":"2025-04-05T21:06:05.891Z","repository":{"id":10029491,"uuid":"63355673","full_name":"urschrei/pypolyline","owner":"urschrei","description":"Fast Google Polyline encoding and decoding using a Rust binary","archived":false,"fork":false,"pushed_at":"2025-03-24T18:26:45.000Z","size":1162,"stargazers_count":42,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T20:03:57.504Z","etag":null,"topics":["computational-geometry","cython","gis","google-maps","google-polyline","polyline","rust"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/pypolyline","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/urschrei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-14T17:20:29.000Z","updated_at":"2025-03-24T18:26:44.000Z","dependencies_parsed_at":"2024-03-18T18:32:40.707Z","dependency_job_id":"757967e3-6c1d-4d7f-9c41-595a7cf9f02d","html_url":"https://github.com/urschrei/pypolyline","commit_stats":{"total_commits":356,"total_committers":4,"mean_commits":89.0,"dds":0.5898876404494382,"last_synced_commit":"8b611d73352c1c0f3851c6a9390049b93049e585"},"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urschrei%2Fpypolyline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urschrei%2Fpypolyline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urschrei%2Fpypolyline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urschrei%2Fpypolyline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urschrei","download_url":"https://codeload.github.com/urschrei/pypolyline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399871,"owners_count":20932876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computational-geometry","cython","gis","google-maps","google-polyline","polyline","rust"],"created_at":"2024-08-01T13:01:28.966Z","updated_at":"2025-04-05T21:06:05.865Z","avatar_url":"https://github.com/urschrei.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"![example workflow](https://github.com/urschrei/pypolyline/actions/workflows/wheels.yml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/urschrei/pypolyline/badge.svg?branch=master)](https://coveralls.io/github/urschrei/pypolyline?branch=master) [![Downloads](https://pepy.tech/badge/pypolyline)](https://pepy.tech/project/pypolyline)[![DOI](https://zenodo.org/badge/63355673.svg)](https://zenodo.org/badge/latestdoi/63355673)\n\n# Fast Google [Polyline](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) Encoding and Decoding\n\n## Installation\n`pip install pypolyline`  \n\n### Supported Python Versions\n- Python 3.9\n- Python 3.10\n- Python 3.11\n- Python 3.12\n- Python 3.13\n\n### Supported Platforms\n- Linux (`manylinux*`-compatible, x86_64 and aarch64)\n- macOS (x86_64 and arm64)\n- Windows 64-bit\n\n## Usage\nCoordinates must be in (`Longitude, Latitude`) order\n\n```python\nfrom pypolyline.cutil import encode_coordinates, decode_polyline\n\ncoords = [\n            [52.64125, 23.70162],\n            [52.64938, 23.70154],\n            [52.64957, 23.68546],\n            [52.64122, 23.68549],\n            [52.64125, 23.70162]\n         ]\n\n# precision is 5 for Google Polyline, 6 for OSRM / Valhalla\npolyline = encode_coordinates(coords, 5)\n# polyline is 'ynh`IcftoCyq@Ne@ncBds@EEycB'\ndecoded_coords = decode_polyline(polyline, 5)\n```\n\n## Error Handling\nFailure to encode coordinates, or to decode a supplied Polyline, will raise a `RuntimeError` containing information about the invalid input.\n\n\n## How it Works\nFFI and a [Rust binary](https://github.com/urschrei/polyline-ffi)\n\n## Is It Fast\n…Yes.  \nYou can verify this by installing the `polyline` package, then running [`benchmarks.py`](benchmarks.py), a calibrated benchmark using `cProfile`.  \nOn an M2 MBP, The [pure-Python](https://pypi.org/project/polyline/) test runs in ~2500 ms, the [Flexpolyline](https://pypi.org/project/flexpolyline/) benchmark runs in ~1500 ms and The Rust + Cython benchmark runs in around 80 ms (30 x and 17.5 x faster, respectively).\n\n## License\n[The Blue Oak Model Licence 1.0.0](LICENCE.md)\n\n## Citing `Pypolyline`\nIf Pypolyline has been significant in your research, and you would like to acknowledge the project in your academic publication, we suggest citing it as follows (example in APA style, 7th edition):\n\n\u003e Hügel, S. (2021). Pypolyline (Version X.Y.Z) [Computer software]. https://doi.org/10.5281/zenodo.5774925\n\nIn Bibtex format:\n\n\n    @software{Hugel_Pypolyline_2021,\n    author = {Hügel, Stephan},\n    doi = {10.5281/zenodo.5774925},\n    license = {MIT},\n    month = {12},\n    title = {{Pypolyline}},\n    url = {https://github.com/urschrei/simplification},\n    version = {X.Y.Z},\n    year = {2021}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furschrei%2Fpypolyline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furschrei%2Fpypolyline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furschrei%2Fpypolyline/lists"}