PHP 클래스 Transport\Entity\Coordinate

파일 보기 프로젝트 열기: opendatach/transport 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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