Documentation

Geopositioned

Trait to add latitude and longitude to the model and also some utility functions for distance measuring.

Table of Contents

$lat  : mixed
$lng  : mixed
_vincentyFormulaDistance()  : float
Calculates the great-circle distance between two points, with the Vincenty formula.
distanceTo()  : float
Calculate distance from this model to a lat/lng pair

Properties

Methods

_vincentyFormulaDistance()

Calculates the great-circle distance between two points, with the Vincenty formula.

public _vincentyFormulaDistance(float $latFrom, float $lngFrom, float $latTo, float $lngTo) : float
Parameters
$latFrom : float

Latitude of start point in [deg decimal]

$lngFrom : float

Longitude of start point in [deg decimal]

$latTo : float

Latitude of target point in [deg decimal]

$lngTo : float

Longitude of target point in [deg decimal]

Return values
float

Distance between points in [m] (same as earthRadius)

distanceTo()

Calculate distance from this model to a lat/lng pair

public distanceTo(mixed $lat, mixed $lng) : float
Parameters
$lat : mixed
$lng : mixed
Return values
float

Search results