A tool to encode/decode HERE legacy polyline strings and convert them from/into HERE Flexible Polyline format.
Note that the HERE Places (Search) API is in maintenance: Developers need to adapt their applications to the newer HERE Geocoding & Search API to benefit from the features developed after 2018.
Install
pip install here-polyline-converter
Usage
>>> convert_legacy_to_flex(legacy_polyline_string)
Transforms a HERE legacy polyline string into a flexible polyline string. The legacy Polyline third dimension (segments width changes) is ignored.
>>> encode_legacy(iterable)
Encodes a list of coordinates to the corresponding HERE legacy polyline string representation.
Expected coordinates order: (lat, lng[, width]). Note that width is expected to be one of DW, HW, CW.
>>> decode_legacy(legacy_polyline_string)
Decodes a HERE legacy polyline string into an array of coordinates (lat, lng[, width]).
Note that width is expected to be one of DW, HW, CW.
Examples
>>> import here_search.polyline_converter as pc
>>> legacy_polyline = "oz5xJ67i1B1B7PzIhaxL7Y"
>>> flexible_polyline = pc.convert_legacy_to_flex(legacy_polyline)
>>> flexible_polyline
'BFoz5xJ67i1B1B7PzIhaxL7Y'
>>> points = [(50.1022829, 8.6982122), (50.1020076, 8.6956695), (50.1006313, 8.6914960), (50.0987800, 8.6875156)]
>>> pc.encode_legacy(points)
'oz5xJ67i1B1B7PzIhaxL7Y'
>>> legacy_polyline = "oz5xJ67i1B.C1B7PzIha.DxL7Y"
>>> pc.decode_legacy(legacy_polyline)
[(50.10228, 8.69821, 'CW'), (50.10201, 8.69567), (50.10063, 8.6915, 'DW'), (50.09878, 8.68752)]
License
Copyright (C) 2023 HERE Europe B.V.
See the LICENSE file in the root of this project for license details.
Metadata
Release files for here-polyline-converter 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| here-polyline-converter-0.2.1.tar.gz | 6.6 kB | Without provenance | Details for here-polyline-converter-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| here_polyline_converter-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for here_polyline_converter-0.2.1-py3-none-any.whl |
Total release size: 12.7 kB
Release files / here-polyline-converter-0.2.1.tar.gz
| Download URL | here-polyline-converter-0.2.1.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb45f97165d07cdb407132860ab9894b6cf8b43c249e59ebbc8751b734c87019
|
|
BLAKE2b-256 checksum How to use checksums |
a12fc250e1224136198e5ec2bfbb152f99ca5c3f3a6262af16a882ba31b9490c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.3
|
Release files / here_polyline_converter-0.2.1-py3-none-any.whl
| Download URL | here_polyline_converter-0.2.1-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ecdb161bfd66a97c98f53b774cd6c3cf87e2d96e24dc47a32a40802a7de15f78
|
|
BLAKE2b-256 checksum How to use checksums |
4a62336c5dcae3df73e70acc9cd415b2de3c0ae6b91b4184f338699e141b9011
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.3
|
Security for here-polyline-converter 0.2.1
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.