PHP Класс League\Geotools\Distance\Distance

Автор: Antoine Corcy ([email protected])
Наследование: extends League\Geotools\AbstractGeotools, implements League\Geotools\Distance\DistanceInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$unit string The user unit.

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

Метод Описание
flat ( ) : double Returns the approximate flat distance between two coordinates using Pythagoras’ theorem which is not very accurate.
getFrom ( ) {@inheritDoc}
getTo ( ) {@inheritDoc}
greatCircle ( ) : double Returns the approximate distance between two coordinates using the spherical trigonometry called Great Circle Distance.
haversine ( ) : double Returns the approximate sea level great circle (Earth) distance between two coordinates using the Haversine formula which is accurate to around 0.3%.
in ( $unit ) {@inheritDoc}
setFrom ( League\Geotools\Coordinate\CoordinateInterface $from ) {@inheritDoc}
setTo ( League\Geotools\Coordinate\CoordinateInterface $to ) {@inheritDoc}
vincenty ( ) : double Returns geodetic distance between between two coordinates using Vincenty inverse formula for ellipsoids which is accurate to within 0.5mm.

Защищенные методы

Метод Описание
convertToUserUnit ( double $meters ) : double Converts results in meters to user's unit (if any).

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

convertToUserUnit() защищенный Метод

The default returned value is in meters.
protected convertToUserUnit ( double $meters ) : double
$meters double
Результат double

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

Returns the approximate flat distance between two coordinates using Pythagoras’ theorem which is not very accurate.
См. также: http://en.wikipedia.org/wiki/Pythagorean_theorem
См. также: http://en.wikipedia.org/wiki/Equirectangular_projection
public flat ( ) : double
Результат double The distance in meters

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

{@inheritDoc}
public getFrom ( )

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

{@inheritDoc}
public getTo ( )

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

Returns the approximate distance between two coordinates using the spherical trigonometry called Great Circle Distance.
См. также: http://www.ga.gov.au/earth-monitoring/geodesy/geodetic-techniques/distance-calculation-algorithms.html#circle
См. также: http://en.wikipedia.org/wiki/Cosine_law
public greatCircle ( ) : double
Результат double The distance in meters

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

Returns the approximate sea level great circle (Earth) distance between two coordinates using the Haversine formula which is accurate to around 0.3%.
См. также: http://www.movable-type.co.uk/scripts/latlong.html
public haversine ( ) : double
Результат double The distance in meters

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

{@inheritDoc}
public in ( $unit )

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

{@inheritDoc}
public setFrom ( League\Geotools\Coordinate\CoordinateInterface $from )
$from League\Geotools\Coordinate\CoordinateInterface

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

{@inheritDoc}
public setTo ( League\Geotools\Coordinate\CoordinateInterface $to )
$to League\Geotools\Coordinate\CoordinateInterface

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

Returns geodetic distance between between two coordinates using Vincenty inverse formula for ellipsoids which is accurate to within 0.5mm.
См. также: http://www.movable-type.co.uk/scripts/latlong-vincenty.html
public vincenty ( ) : double
Результат double The distance in meters

Описание свойств

$unit защищенное свойство

The user unit.
protected string $unit
Результат string