This project is deprecated. Please check here-polyline-converter
FlexPolyline and HERE Polyline
This is Python extension of the Flexible Polyline
codec library to support the HERE polyline format used by
HERE Places (Search) API
for the compressedRoute requests parameter.
Note that the HERE Places (Search) API is in maintenance. This Python package can be used to test applications being migrated to the newer HERE Geocoding & Search API.
Install
$ pip install python-flexpolyline-pbapi
Usage
>>> reencode_pbapi_to_flex(here_polyline_string)
Transforms a HERE polyline string into a flexible polyline string.
The HERE Polyline segments width changes are ignored: The resulting corridor will be of constant width, expressed
in HERE geocoding & Search API as a specific request
parameter width.
>>> encode_pbapi(iterable)
Encodes a list (or iterator) of coordinates to the corresponding HERE polyline string representation.
Coordinate order is (lat, lng[, width]).
>>> decode_pbapi(here_polyline_string)
Decodes a HERE polyline string into an array of coordinates (lat, lng[, width]).
>>> encode_pbapi(iterable)
Note that width is expected to be one of DW, HW, CW.
Examples
>>> import flexpolyline_pbapi as fp
>>> here_polyline = "oz5xJ67i1B1B7PzIhaxL7Y"
>>> flexible_polyline = fp.reencode_pbapi_to_flex(here_polyline)
>>> flexible_polyline
'BFoz5xJ67i1B1B7PzIhaxL7Y'
>>> points = [ (50.1022829, 8.6982122), (50.1020076, 8.6956695), (50.1006313, 8.6914960), (50.0987800, 8.6875156) ]
>>> fp.encode_pbapi(points)
'oz5xJ67i1B1B7PzIhaxL7Y'
>>> here_polyline = "oz5xJ67i1B.C1B7PzIha.DxL7Y"
>>> fp.decode_pbapi(here_polyline)
[(50.10228, 8.69821, 'CW'), (50.10201, 8.69567), (50.10063, 8.6915, 'DW'), (50.09878, 8.68752)]
License
Copyright (C) 2019 HERE Europe B.V.
See the LICENSE file in the root of this project for license details.
Metadata
Release files for python-flexpolyline-pbapi 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 | |
|---|---|---|---|
| python-flexpolyline-pbapi-0.2.1.tar.gz | 8.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_flexpolyline_pbapi-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.8 kB
Release files / python-flexpolyline-pbapi-0.2.1.tar.gz
| Download URL | python-flexpolyline-pbapi-0.2.1.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0385e00f65fbf0f2d81cb3752a2d89f4726da7be826fee72070e6d8663b5da5
|
|
BLAKE2b-256 checksum How to use checksums |
97e3ecceb2b5f4deb2b9da0fbffedd2c0a81cdec05cb2c2eba7ed1c5a957260b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.7
|
Release files / python_flexpolyline_pbapi-0.2.1-py3-none-any.whl
| Download URL | python_flexpolyline_pbapi-0.2.1-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe9518222553aa380b92f125a7d10a88a9130539a2f607cc5952d2ad14f2b282
|
|
BLAKE2b-256 checksum How to use checksums |
eb90ec652cfe31481f8af084f48ea78e756d62e2fd0d804cf077052c4b5407cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.7
|