Skip to main content

Fast Google Polyline encoding and decoding using Rust FFI

Project description

Installation

pip install pypolyline Please use a recent (>= 8.1.2) version of pip.

Supported Python Versions

Python 2.7 Python 3.5

Supported Platforms

  • Linux (manylinux1-compatible)

  • OS X

  • Windows 32-bit / 64-bit

Usage

from pypolyline.util import encode_coordinates, decode_polyline

coords = [
            [52.64125, 23.70162],
            [52.64938, 23.70154],
            [52.64957, 23.68546],
            [52.64122, 23.68549],
            [52.64125, 23.70162]
            ]

# precision is 5 for Google Polyline, 6 for OSRM / Valhalla
polyline = encode_coordinates(coords, 5)
# polyline is 'ynh`IcftoCyq@Ne@ncBds@EEycB'
decoded_coords = decode_polyline(polyline, 5)

Attempts to decode an invalid Polyline will throw util.DecodingError

Attempts to encode invalid coordinates will throw util.EncodingError

How it Works

FFI using ctypes and a Rust binary

License

MIT

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pypolyline-0.1.5-py2.py3-none-win_amd64.whl (728.8 kB view details)

Uploaded Python 2Python 3Windows x86-64

pypolyline-0.1.5-py2.py3-none-win32.whl (788.3 kB view details)

Uploaded Python 2Python 3Windows x86

pypolyline-0.1.5-py2.py3-none-manylinux1_x86_64.whl (541.9 kB view details)

Uploaded Python 2Python 3

pypolyline-0.1.5-py2.py3-none-macosx_10_6_intel.whl (668.2 kB view details)

Uploaded Python 2Python 3macOS 10.6+ Intel (x86-64, i386)

File details

Details for the file pypolyline-0.1.5-py2.py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for pypolyline-0.1.5-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 edd2731c529ded56150999da02d4131b1c2edfe23af2efda980e1e9cd0f35224
MD5 0220a2ce13358d210bbf69627138d046
BLAKE2b-256 dd9ef2a66e2ba8993f78a6d08b253386ce11a9b80af0193b606880f682f626e2

See more details on using hashes here.

File details

Details for the file pypolyline-0.1.5-py2.py3-none-win32.whl.

File metadata

File hashes

Hashes for pypolyline-0.1.5-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 bdcdd2a9b1724469a6f06cc3303f7d044c67441fd3d9bde624d8295da1fb2ab4
MD5 7254885724372d647b69cf058c1ee013
BLAKE2b-256 13111ae60e93c71c8237fe472a1593b24c8b86ea9e758b7c50d6289756d45a80

See more details on using hashes here.

File details

Details for the file pypolyline-0.1.5-py2.py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pypolyline-0.1.5-py2.py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e7e910868b1c7e81c17a4c03666aa63926dd1e594946b9f225818322dc98f6bb
MD5 f9cb6530fca4803c8f32a9fa0a66ce91
BLAKE2b-256 6626a3813cded310b9a509de9a5bd76936f3682a80ae059546cf678581eb5122

See more details on using hashes here.

File details

Details for the file pypolyline-0.1.5-py2.py3-none-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for pypolyline-0.1.5-py2.py3-none-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 aa0e3e4dff7afc961a771178b47fe2f3480a3e18098f17f8e89a503996767f38
MD5 b5d8139c3e537f87ca5cbe56189d759e
BLAKE2b-256 5f7399779b7bf016822392eee7eb58bc099103febd0f8d22d333e4f2281b32b6

See more details on using hashes here.

Supported by

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