PHP Класс Location\Processor\Polyline\SimplifyBearing

Автор: Marcus Jaschen ([email protected])
Наследование: implements Location\Processor\Polyline\SimplifyInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( float $bearingAngle ) SimplifyBearing constructor.
simplify ( Polyline $polyline ) : Polyline Simplifies the given polyline

Описание методов

__construct() публичный Метод

SimplifyBearing constructor.
public __construct ( float $bearingAngle )
$bearingAngle float

simplify() публичный Метод

1. calculate the bearing angle between the first two points p1 and p2: b1 2. calculate the bearing angle between the next two points p2 and p3: b2 3. calculate the difference between b1 and b2: deltaB; if deltaB is smaller than the threshold angle, remove the middle point p2 4. start again at (1.) as long as the polyline contains more points
public simplify ( Polyline $polyline ) : Polyline
$polyline Location\Polyline
Результат Location\Polyline