trajectory
trajectory is a library for lossy compression of trajectory data based on Google’s Encoded Polyline Algorithm Format (http://goo.gl/PvXf8Y). It is heavily based on (in fact forked from) https://github.com/hicsail/polyline.
Installation
trajectory can be installed using pip or easy_install
$ pip install trajectory
or
$ easy_install trajectory
API Documentation
Encoding
To serialize a trajectory (set of (lat, lon, unix time in seconds) tuples)
import trajectory
trajectory.encode([
(38.500, -120.200, 1582482601),
(40.700, -120.950, 1582482611),
(43.252, -126.453, 1582482627)
], 5)
This should return _p~iF~ps|U_ynpijgz~G_ulLnnqC_c`|@_mqNvxq`@__t`B.
You can set the required precision with the optional precision parameter. The default value is 5.
Decoding
To deserialize a trajectory (set of (lat, lon, unix time in seconds) tuples) represented by an encoded string
import trajectory
trajectory.decode('_p~iF~ps|U_ynpijgz~G_ulLnnqC_c`|@_mqNvxq`@__t`B', 5)
This should return the following:
[
(38.500, -120.200, 1582482601),
(40.700, -120.950, 1582482611),
(43.252, -126.453, 1582482627)
]
You can set the required precision with the optional precision parameter. The default value is 5.
Development
Setup Dependencies
$ poetry install
Running Tests
$ poetry run pytest
Contributing
Issues and pull requests are welcome.
For proposing new features/improvements or reporting bugs, create an issue.
Check open issues for viewing existing ideas, verify if it is already proposed/being worked upon.
When implementing new features make sure to add relavant tests and documentation before sending pull requests.
Metadata
Release files for trajectory 0.1.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 |
|---|---|---|---|---|
| trajectory-0.1.1.tar.gz | 4.5 kB | Without provenance | Details for trajectory-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trajectory-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for trajectory-0.1.1-py3-none-any.whl |
Total release size: 9.1 kB
Release files / trajectory-0.1.1.tar.gz
| Download URL | trajectory-0.1.1.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8631b3a943f10042d55a7d680a024436b3876049992d9447a4872e84b15b942c
|
|
BLAKE2b-256 checksum How to use checksums |
fa706d5b12d36264d77e577c61699a307c8a02eba9573647d51c35b577e4b9b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0b5 CPython/3.8.1 Linux/5.5.4-arch1-1
|
Release files / trajectory-0.1.1-py3-none-any.whl
| Download URL | trajectory-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2a08f8f6ffaa8a70ea899d641f88386414a73de77883403395f42f17a2cad1e
|
|
BLAKE2b-256 checksum How to use checksums |
2bc69067bc3a3c4f891b37976ed28ef7c1979a1eb39500da3ddb44826a9f4ca1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0b5 CPython/3.8.1 Linux/5.5.4-arch1-1
|
Security for trajectory 0.1.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.