Skip to main content

Fast Google Encoded Polyline encoding & decoding in Rust

Project description

polyline-rs

PyPI - Python Version Liberapay Patrons GitHub Sponsors

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

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.

pip install polyline-rs

Basic usage

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)]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyline_rs-1.1.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distributions

polyline_rs-1.1.0-cp39-abi3-win_amd64.whl (105.4 kB view details)

Uploaded CPython 3.9+ Windows x86-64

polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_x86_64.whl (399.8 kB view details)

Uploaded CPython 3.9+ musllinux: musl 1.2+ x86-64

polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_aarch64.whl (415.9 kB view details)

Uploaded CPython 3.9+ musllinux: musl 1.2+ ARM64

polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (217.7 kB view details)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ x86-64

polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (208.6 kB view details)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ ARM64

polyline_rs-1.1.0-cp39-abi3-macosx_11_0_arm64.whl (201.6 kB view details)

Uploaded CPython 3.9+ macOS 11.0+ ARM64

polyline_rs-1.1.0-cp39-abi3-macosx_10_12_x86_64.whl (205.7 kB view details)

Uploaded CPython 3.9+ macOS 10.12+ x86-64

File details

Details for the file polyline_rs-1.1.0.tar.gz.

File metadata

  • Download URL: polyline_rs-1.1.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for polyline_rs-1.1.0.tar.gz
Algorithm Hash digest
SHA256 227a3eef0beadd015eba6694ce5635034f3e5661de4a9751ef0496d33380175f
MD5 af6c448578df16362acd3921bd147360
BLAKE2b-256 df073e102293e8c9e06a557307ff9bb444803313f6d483b09346435de842d25f

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyline_rs-1.1.0.tar.gz:

Publisher: workflow.yaml on Zaczero/polyline-rs

Attestations:

File details

Details for the file polyline_rs-1.1.0-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for polyline_rs-1.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3cb5b4863bcbab9d24477dad64db9f4648be1904ac95558a0c0095463ab100d0
MD5 3c5acb7f4458fdb638cef203073de60a
BLAKE2b-256 4d556f2374091748deec79363cb997c4146db6931666e114f575c64bb5ad5424

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyline_rs-1.1.0-cp39-abi3-win_amd64.whl:

Publisher: workflow.yaml on Zaczero/polyline-rs

Attestations:

File details

Details for the file polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 896464f9e08122e0dd95ce7c3b2623abaf0f187e0508c34fbb417f8ea857261d
MD5 3c887dc01679b9a210172c824207a0c0
BLAKE2b-256 7b97ff5ad209b1e89d3d0a62ef52e3e426c0f3820f30c842d4afc318af5ca6ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_x86_64.whl:

Publisher: workflow.yaml on Zaczero/polyline-rs

Attestations:

File details

Details for the file polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 16a3b2b58a5ba636b820fca69e9e2a4436070c2ded2c64c9d4d9591e4529e0b8
MD5 8942b361436fe8d3e22c2c794fbc3b52
BLAKE2b-256 a3c85ccd787f91d55c773f566f9eb98b52c0d4fbf8ba0da5f46d5e8a2852682f

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyline_rs-1.1.0-cp39-abi3-musllinux_1_2_aarch64.whl:

Publisher: workflow.yaml on Zaczero/polyline-rs

Attestations:

File details

Details for the file polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 807fd48d25defafd9ccb5440e89ced227a064304f07ff122fcaff3eca7e5ee31
MD5 3a7ec405db0e773652c5ae23e8c41981
BLAKE2b-256 8335582318a6eb3146f0eadfce10606d9f854b2604c3444e3043a9034c4f5195

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yaml on Zaczero/polyline-rs

Attestations:

File details

Details for the file polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8fe51996f2a4d4fbc075c65f016123800ea2196a5a65672fcf4ef2eba2c211ef
MD5 950bfc61278a39c856705ace5d7f1c39
BLAKE2b-256 cc1682a6a323f860f568b4d1efc89b6a58de9d21ece2b0a46e3ae40a66857235

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyline_rs-1.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: workflow.yaml on Zaczero/polyline-rs

Attestations:

File details

Details for the file polyline_rs-1.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polyline_rs-1.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d1861d913ee0f5b534051a964ce208e1be1e94156db2bfe6c7b3dd1ffd084245
MD5 9b5fc766a2de766ec0591643a1bb55e4
BLAKE2b-256 a2b3eee4e620cbfa52c5e7d7f16ac19b956b46fc6bd8987a757807370806cb05

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyline_rs-1.1.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: workflow.yaml on Zaczero/polyline-rs

Attestations:

File details

Details for the file polyline_rs-1.1.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for polyline_rs-1.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f60a2fe486b763e46261f2e60c203128eb3e0871b884db07c6e203e2e9b3fbd7
MD5 aaaf2e33cf0074a77b901bb4c52a0bea
BLAKE2b-256 693c9a9407c42cafb73d0da3a62f64a4750897962de2cfc63e5de1e65204e643

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyline_rs-1.1.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: workflow.yaml on Zaczero/polyline-rs

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page