traewelling/google-polyline

A PHP library for encoding and decoding Google Maps polylines.

Installs: 1 310

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/traewelling/google-polyline

v0.1 2025-07-15 22:22 UTC

This package is auto-updated.

Last update: 2025-09-16 19:16:43 UTC


README

run-tests PHPStan GitHub License Codacy Badge Codacy Badge

Since Transitous/Motis uses a non-standard implementation of Google's Encoded Polyline Algorithm Format, we needed to implement a custom decoder for it.

Motis returns a EPAF string in the legGeometry field with a custom precision of 7 decimal places in v1 and 6 decimal places in v2. Google's implementation uses 5 decimal places, so we need to adjust the precision accordingly.

This package supports every possible precision but is only tested with 5 and 6 decimal places.