Property | Type | Description | |
---|---|---|---|
$type | string | The type of the given coordinate. | |
$x | float | Latitude. | |
$y | float | Longitude. |
Method | Description | |
---|---|---|
createFromJson ( $json ) | ||
createFromXml ( SimpleXMLElement $xml ) : |
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 ) |
public static createFromXml ( SimpleXMLElement $xml ) : |
||
$xml | SimpleXMLElement | The item xml |
return | The created instance |
public getDistanceTo ( $lat, $lon ) : float | ||
return | float |
public static setHAFAScoordinates ( $coordinate, $x, $y ) |