PHP Класс Transport\Entity\Coordinate

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$type string The type of the given coordinate.
$x float Latitude.
$y float Longitude.

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

Метод Описание
createFromJson ( $json )
createFromXml ( SimpleXMLElement $xml ) : Coordinate Factory method to create an instance of Coordinate and extract the data from the given xml.
floatToInt ( $float )
getDistanceTo ( $lat, $lon ) : float Calculates the distance to another coordinate using the Haversine Formula.
intToFloat ( $int )
setHAFAScoordinates ( $coordinate, $x, $y )

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

createFromJson() публичный статический Метод

public static createFromJson ( $json )

createFromXml() публичный статический Метод

Factory method to create an instance of Coordinate and extract the data from the given xml.
public static createFromXml ( SimpleXMLElement $xml ) : Coordinate
$xml SimpleXMLElement The item xml
Результат Coordinate The created instance

floatToInt() публичный статический Метод

public static floatToInt ( $float )

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

Not really accurate.
public getDistanceTo ( $lat, $lon ) : float
Результат float

intToFloat() публичный статический Метод

public static intToFloat ( $int )

setHAFAScoordinates() публичный статический Метод

public static setHAFAScoordinates ( $coordinate, $x, $y )

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

$type публичное свойство

The type of the given coordinate.
public string $type
Результат string

$x публичное свойство

Latitude.
public float $x
Результат float

$y публичное свойство

Longitude.
public float $y
Результат float