Skip to main content

polyline

http://img.shields.io/travis/hicsail/polyline.svg?style=flat http://img.shields.io/pypi/v/polyline.svg?style=flat

polyline is a Python implementation of Google’s Encoded Polyline Algorithm Format (http://goo.gl/PvXf8Y). It is essentially a port of https://github.com/mapbox/polyline built with Python 2 and 3 support in mind.

Installation

polyline can be installed using pip or easy_install:

$ pip install polyline
or
$ easy_install polyline

API Documentation

Encoding

To get the encoded polyline representation of a given set of (lat, lon) coordinates:

import polyline
polyline.encode([(38.5, -120.2), (40.7, -120.9), (43.2, -126.4)], 5)

This should return _p~iF~ps|U_ulL~ugC_hgN~eq`@.

You can set the required precision with the optional precision parameter. The default value is 5.

You can encode (lon, lat) tuples by setting geojson=True.

Decoding

To get a set of coordinates represented by a given encoded polyline string:

import polyline
polyline.decode('u{~vFvyys@fS]')

This should return [(40.63179, -8.65708), (40.62855, -8.65693)] in (lat, lon) order.

You can decode into (lon, lat) tuples by setting geojson=True.

Metadata

Release files for polyline 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polyline 1.4.0
File Size Uploaded Provenance Actions
polyline-1.4.0.tar.gz 5.4 kB Without provenance Details for polyline-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polyline 1.4.0
File Interpreter ABI Platform Actions
polyline-1.4.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for polyline-1.4.0-py2.py3-none-any.whl

Total release size: 9.8 kB

Release files / polyline-1.4.0.tar.gz

Download URL polyline-1.4.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7c7f89d09a09c7b6161bdbfb4fd304b186fc7a2060fa4f31cb3f61c646a5c074
BLAKE2b-256 checksum
How to use checksums
86f0aafef2bbaca2e242cef7d02612e989f7c8628e326094574fcba5f652b055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / polyline-1.4.0-py2.py3-none-any.whl

Download URL polyline-1.4.0-py2.py3-none-any.whl
Size 4.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6559a0d5d37f4d14255744b3c6a648d5ff480d3d5c5f30186effc72a4142fd6c
BLAKE2b-256 checksum
How to use checksums
0c4a67edcfd960ff64221782531c867d862acc6a4e85b382a291bcb820dcde72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Security for polyline 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page