# polyline-rs
[![PyPI - Python Version](https://shields.monicz.dev/pypi/pyversions/polyline-rs)](https://pypi.org/project/polyline-rs)
[![Liberapay Patrons](https://shields.monicz.dev/liberapay/patrons/Zaczero?logo=liberapay&label=Patrons)](https://liberapay.com/Zaczero/)
[![GitHub Sponsors](https://shields.monicz.dev/github/sponsors/Zaczero?logo=github&label=Sponsors&color=%23db61a2)](https://github.com/sponsors/Zaczero)
Fast Google Encoded Polyline encoding & decoding in Rust. A Python PyO3 library with out-of-the-box support for both (lat, lon) and (lon, lat) coordinates.
[Encoded Polyline Algorithm Format](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
## Installation
The recommended installation method is through the PyPI package manager. The project is implemented in Rust and several pre-built binary wheels are available for Linux, macOS, and Windows, with support for both x64 and ARM architectures.
```sh
pip install polyline-rs
```
## Basic usage
```py
from polyline_rs import encode_latlon, encode_lonlat, decode_latlon, decode_lonlat
line = encode_latlon([(38.5, -120.2), (40.7, -120.95), (43.252, -126.453)], 5)
assert line == "_p~iF~ps|U_ulLnnqC_mqNvxq`@"
coords = decode_latlon(line, 5)
assert coords == [(38.5, -120.2), (40.7, -120.95), (43.252, -126.453)]
coords2 = decode_lonlat(line, 5)
assert coords2 == [(-120.2, 38.5), (-120.95, 40.7), (-126.453, 43.252)]
```
Raw data
{
"_id": null,
"home_page": null,
"name": "polyline-rs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "decoding, encoding, gis, google, mapbox, openstreetmap, polyline",
"author": null,
"author_email": "Kamil Monicz <kamil@monicz.dev>",
"download_url": "https://files.pythonhosted.org/packages/df/07/3e102293e8c9e06a557307ff9bb444803313f6d483b09346435de842d25f/polyline_rs-1.1.0.tar.gz",
"platform": null,
"description": "# polyline-rs\n\n[![PyPI - Python Version](https://shields.monicz.dev/pypi/pyversions/polyline-rs)](https://pypi.org/project/polyline-rs)\n[![Liberapay Patrons](https://shields.monicz.dev/liberapay/patrons/Zaczero?logo=liberapay&label=Patrons)](https://liberapay.com/Zaczero/)\n[![GitHub Sponsors](https://shields.monicz.dev/github/sponsors/Zaczero?logo=github&label=Sponsors&color=%23db61a2)](https://github.com/sponsors/Zaczero)\n\nFast Google Encoded Polyline encoding & decoding in Rust. A Python PyO3 library with out-of-the-box support for both (lat, lon) and (lon, lat) coordinates.\n\n[Encoded Polyline Algorithm Format](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)\n\n## Installation\n\nThe recommended installation method is through the PyPI package manager. The project is implemented in Rust and several pre-built binary wheels are available for Linux, macOS, and Windows, with support for both x64 and ARM architectures.\n\n```sh\npip install polyline-rs\n```\n\n## Basic usage\n\n```py\nfrom polyline_rs import encode_latlon, encode_lonlat, decode_latlon, decode_lonlat\n\nline = encode_latlon([(38.5, -120.2), (40.7, -120.95), (43.252, -126.453)], 5)\nassert line == \"_p~iF~ps|U_ulLnnqC_mqNvxq`@\"\n\ncoords = decode_latlon(line, 5)\nassert coords == [(38.5, -120.2), (40.7, -120.95), (43.252, -126.453)]\n\ncoords2 = decode_lonlat(line, 5)\nassert coords2 == [(-120.2, 38.5), (-120.95, 40.7), (-126.453, 43.252)]\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Fast Google Encoded Polyline encoding & decoding in Rust",
"version": "1.1.0",
"project_urls": {
"Issues": "https://github.com/Zaczero/polyline-rs/issues",
"Repository": "https://github.com/Zaczero/polyline-rs"
},
"split_keywords": [
"decoding",
" encoding",
" gis",
" google",
" mapbox",
" openstreetmap",
" polyline"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "693c9a9407c42cafb73d0da3a62f64a4750897962de2cfc63e5de1e65204e643",
"md5": "aaaf2e33cf0074a77b901bb4c52a0bea",
"sha256": "f60a2fe486b763e46261f2e60c203128eb3e0871b884db07c6e203e2e9b3fbd7"
},
"downloads": -1,
"filename": "polyline_rs-1.1.0-cp39-abi3-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "aaaf2e33cf0074a77b901bb4c52a0bea",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 205690,
"upload_time": "2024-10-30T02:32:31",
"upload_time_iso_8601": "2024-10-30T02:32:31.463053Z",
"url": "https://files.pythonhosted.org/packages/69/3c/9a9407c42cafb73d0da3a62f64a4750897962de2cfc63e5de1e65204e643/polyline_rs-1.1.0-cp39-abi3-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a2b3eee4e620cbfa52c5e7d7f16ac19b956b46fc6bd8987a757807370806cb05",
"md5": "9b5fc766a2de766ec0591643a1bb55e4",
"sha256": "d1861d913ee0f5b534051a964ce208e1be1e94156db2bfe6c7b3dd1ffd084245"
},
"downloads": -1,
"filename": "polyline_rs-1.1.0-cp39-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "9b5fc766a2de766ec0591643a1bb55e4",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 201561,
"upload_time": "2024-10-30T02:32:33",
"upload_time_iso_8601": "2024-10-30T02:32:33.284603Z",
"url": "https://files.pythonhosted.org/packages/a2/b3/eee4e620cbfa52c5e7d7f16ac19b956b46fc6bd8987a757807370806cb05/polyline_rs-1.1.0-cp39-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc1682a6a323f860f568b4d1efc89b6a58de9d21ece2b0a46e3ae40a66857235",
"md5": "950bfc61278a39c856705ace5d7f1c39",
"sha256": "8fe51996f2a4d4fbc075c65f016123800ea2196a5a65672fcf4ef2eba2c211ef"
},
"downloads": -1,
"filename": "polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "950bfc61278a39c856705ace5d7f1c39",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 208557,
"upload_time": "2024-10-30T02:32:34",
"upload_time_iso_8601": "2024-10-30T02:32:34.973385Z",
"url": "https://files.pythonhosted.org/packages/cc/16/82a6a323f860f568b4d1efc89b6a58de9d21ece2b0a46e3ae40a66857235/polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8335582318a6eb3146f0eadfce10606d9f854b2604c3444e3043a9034c4f5195",
"md5": "3a7ec405db0e773652c5ae23e8c41981",
"sha256": "807fd48d25defafd9ccb5440e89ced227a064304f07ff122fcaff3eca7e5ee31"
},
"downloads": -1,
"filename": "polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "3a7ec405db0e773652c5ae23e8c41981",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 217662,
"upload_time": "2024-10-30T02:32:36",
"upload_time_iso_8601": "2024-10-30T02:32:36.600136Z",
"url": "https://files.pythonhosted.org/packages/83/35/582318a6eb3146f0eadfce10606d9f854b2604c3444e3043a9034c4f5195/polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a3c85ccd787f91d55c773f566f9eb98b52c0d4fbf8ba0da5f46d5e8a2852682f",
"md5": "8942b361436fe8d3e22c2c794fbc3b52",
"sha256": "16a3b2b58a5ba636b820fca69e9e2a4436070c2ded2c64c9d4d9591e4529e0b8"
},
"downloads": -1,
"filename": "polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_aarch64.whl",
"has_sig": false,
"md5_digest": "8942b361436fe8d3e22c2c794fbc3b52",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 415904,
"upload_time": "2024-10-30T02:32:37",
"upload_time_iso_8601": "2024-10-30T02:32:37.851805Z",
"url": "https://files.pythonhosted.org/packages/a3/c8/5ccd787f91d55c773f566f9eb98b52c0d4fbf8ba0da5f46d5e8a2852682f/polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7b97ff5ad209b1e89d3d0a62ef52e3e426c0f3820f30c842d4afc318af5ca6ac",
"md5": "3c887dc01679b9a210172c824207a0c0",
"sha256": "896464f9e08122e0dd95ce7c3b2623abaf0f187e0508c34fbb417f8ea857261d"
},
"downloads": -1,
"filename": "polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "3c887dc01679b9a210172c824207a0c0",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 399817,
"upload_time": "2024-10-30T02:32:39",
"upload_time_iso_8601": "2024-10-30T02:32:39.795143Z",
"url": "https://files.pythonhosted.org/packages/7b/97/ff5ad209b1e89d3d0a62ef52e3e426c0f3820f30c842d4afc318af5ca6ac/polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4d556f2374091748deec79363cb997c4146db6931666e114f575c64bb5ad5424",
"md5": "3c5acb7f4458fdb638cef203073de60a",
"sha256": "3cb5b4863bcbab9d24477dad64db9f4648be1904ac95558a0c0095463ab100d0"
},
"downloads": -1,
"filename": "polyline_rs-1.1.0-cp39-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "3c5acb7f4458fdb638cef203073de60a",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 105387,
"upload_time": "2024-10-30T02:32:41",
"upload_time_iso_8601": "2024-10-30T02:32:41.764914Z",
"url": "https://files.pythonhosted.org/packages/4d/55/6f2374091748deec79363cb997c4146db6931666e114f575c64bb5ad5424/polyline_rs-1.1.0-cp39-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "df073e102293e8c9e06a557307ff9bb444803313f6d483b09346435de842d25f",
"md5": "af6c448578df16362acd3921bd147360",
"sha256": "227a3eef0beadd015eba6694ce5635034f3e5661de4a9751ef0496d33380175f"
},
"downloads": -1,
"filename": "polyline_rs-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "af6c448578df16362acd3921bd147360",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 13032,
"upload_time": "2024-10-30T02:32:42",
"upload_time_iso_8601": "2024-10-30T02:32:42.835265Z",
"url": "https://files.pythonhosted.org/packages/df/07/3e102293e8c9e06a557307ff9bb444803313f6d483b09346435de842d25f/polyline_rs-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-30 02:32:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Zaczero",
"github_project": "polyline-rs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "polyline-rs"
}