{"id":13936596,"url":"https://github.com/frederickjansen/polyline","last_synced_at":"2025-10-07T16:03:49.792Z","repository":{"id":28939502,"uuid":"32465333","full_name":"frederickjansen/polyline","owner":"frederickjansen","description":"A Python implementation of Google's Encoded Polyline Algorithm Format.","archived":false,"fork":false,"pushed_at":"2024-02-12T16:55:21.000Z","size":66,"stargazers_count":120,"open_issues_count":0,"forks_count":19,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T03:51:15.529Z","etag":null,"topics":["polyline","python"],"latest_commit_sha":null,"homepage":"http://goo.gl/PvXf8Y","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frederickjansen.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-18T14:57:01.000Z","updated_at":"2025-03-17T00:11:38.000Z","dependencies_parsed_at":"2024-04-27T23:59:25.885Z","dependency_job_id":"c7a35a1e-b657-44f7-863e-01415ca394cc","html_url":"https://github.com/frederickjansen/polyline","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frederickjansen%2Fpolyline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frederickjansen%2Fpolyline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frederickjansen%2Fpolyline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frederickjansen%2Fpolyline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frederickjansen","download_url":"https://codeload.github.com/frederickjansen/polyline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157281,"owners_count":20893220,"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":["polyline","python"],"created_at":"2024-08-07T23:02:49.662Z","updated_at":"2025-10-07T16:03:44.758Z","avatar_url":"https://github.com/frederickjansen.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"polyline\n========\n\n.. image:: http://img.shields.io/pypi/v/polyline.svg?style=flat\n    :target: https://pypi.python.org/pypi/polyline/\n.. image:: https://readthedocs.org/projects/polyline/badge/?version=latest\n    :target: https://polyline.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n.. image:: https://github.com/frederickjansen/polyline/actions/workflows/lint-test-docs.yml/badge.svg\n    :target: https://github.com/frederickjansen/polyline/actions/workflows/lint-test-docs.yml\n    :alt: Build\n\n``polyline`` is a Python implementation of Google's `Encoded Polyline Algorithm\nFormat \u003chttps://developers.google.com/maps/documentation/utilities/polylinealgorithm\u003e`__. It is essentially a port of `Mapbox polyline \u003chttps://github.com/mapbox/polyline\u003e`__ with some additional features.\n\nInstallation\n------------\n\n``polyline`` can be installed using ``pip``::\n\n    $ pip install polyline\n\nStarting from ``v2.0.0`` only Python 3.7 and above is supported. For Python 2 support, please install ``v1.4.0``::\n\n    $ pip install polyline==1.4.0\n\nAPI Documentation\n-----------------\n\nEncoding\n^^^^^^^^\n\nTo get the encoded polyline representation of a given set of (lat, lon) coordinates::\n\n    import polyline\n    polyline.encode([(38.5, -120.2), (40.7, -120.9), (43.2, -126.4)], 5)\n\nThis should return ``_p~iF~ps|U_ulL~ugC_hgN~eq`@``.\n\nYou can set the required precision with the optional ``precision`` parameter. The default value is 5.\n\nYou can encode (lon, lat) tuples by setting ``geojson=True``.\n\nDecoding\n^^^^^^^^\n\nTo get a set of coordinates represented by a given encoded polyline string::\n\n    import polyline\n    polyline.decode('u{~vFvyys@fS]', 5)\n\nThis should return ``[(40.63179, -8.65708), (40.62855, -8.65693)]`` in (lat, lon) order.\n\nYou can set the required precision with the optional ``precision`` parameter. The default value is 5.\n\nYou can decode into (lon, lat) tuples by setting ``geojson=True``.\n\n\nDevelopment\n-----------\nAll installation and development dependencies are fully specified in ``pyproject.toml``. The ``project.optional-dependencies`` object is used to `specify optional requirements \u003chttps://setuptools.pypa.io/en/latest/userguide/pyproject_config.html\u003e`__ for various development tasks. This makes it possible to specify additional options when performing installation using ``pip``::\n\n    python -m pip install .[dev]\n\nDocumentation\n^^^^^^^^^^^^^\nThe documentation can be generated automatically from the source files using `Sphinx \u003chttps://www.sphinx-doc.org\u003e`__::\n\n    python -m sphinx.cmd.build -b html docs docs/_build/html\n\nTesting and Conventions\n^^^^^^^^^^^^^^^^^^^^^^^\nAll unit tests are executed and their coverage is measured when using `pytest \u003chttps://docs.pytest.org\u003e`__::\n\n    python -m pytest\n\nStyle conventions are enforced using `Pylint \u003chttps://pylint.pycqa.org\u003e`__::\n\n    python -m pylint polyline\n\nContributions\n^^^^^^^^^^^^^\nIn order to contribute to the source code, open an issue or submit a pull request on the `GitHub page \u003chttps://github.com/frederickjansen/polyline\u003e`__ for this library.\n\nVersioning\n^^^^^^^^^^\nBeginning with version 0.1.0, the version number format for this library and the changes to the library associated with version number increments conform with `Semantic Versioning 2.0.0 \u003chttps://semver.org/#semantic-versioning-200\u003e`__.\n\nPublishing\n^^^^^^^^^^\nThis library can be published as a `package on PyPI \u003chttps://pypi.org/project/polyline\u003e`__ by a package maintainer. Ensure that the correct version number appears in ``pyproject.toml``, and that any links in this README document to the Read the Docs documentation of this package (or its dependencies) have appropriate version numbers. Also ensure that the Read the Docs project for this library has an `automation rule \u003chttps://docs.readthedocs.io/en/stable/automation-rules.html\u003e`__ that activates and sets as the default all tagged versions. Create and push a tag for this version (replacing ``?.?.?`` with the version number)::\n\n    git tag ?.?.?\n    git push origin ?.?.?\n\nRemove any old build/distribution files. Then, package the source into a distribution archive::\n\n    rm -rf build dist src/*.egg-info\n    python -m build --sdist --wheel .\n\nFinally, upload the package distribution archive to `PyPI \u003chttps://pypi.org\u003e`__::\n\n    python -m twine upload dist/*\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrederickjansen%2Fpolyline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrederickjansen%2Fpolyline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrederickjansen%2Fpolyline/lists"}