PHP Class Transport\Entity\Coordinate

Afficher le fichier Open project: opendatach/transport Class Usage Examples

Méthodes publiques

Свойство Type Description
$type string The type of the given coordinate.
$x float Latitude.
$y float Longitude.

Méthodes publiques

Méthode Description
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 )

Method Details

createFromJson() public static méthode

public static createFromJson ( $json )

createFromXml() public static méthode

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
Résultat Coordinate The created instance

floatToInt() public static méthode

public static floatToInt ( $float )

getDistanceTo() public méthode

Not really accurate.
public getDistanceTo ( $lat, $lon ) : float
Résultat float

intToFloat() public static méthode

public static intToFloat ( $int )

setHAFAScoordinates() public static méthode

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

Property Details

$type public_oe property

The type of the given coordinate.
public string $type
Résultat string

$x public_oe property

Latitude.
public float $x
Résultat float

$y public_oe property

Longitude.
public float $y
Résultat float