PHP Class Location\Coordinate

Author: Marcus Jaschen ([email protected])
Inheritance: implements location\GeometryInterface
Afficher le fichier Open project: mjaschen/phpgeo Class Usage Examples

Protected Properties

Свойство Type Description
$ellipsoid Ellipsoid
$lat float
$lng float

Méthodes publiques

Méthode Description
__construct ( float $lat, float $lng, Ellipsoid $ellipsoid = null )
format ( Location\Formatter\Coordinate\FormatterInterface $formatter ) : mixed
getDistance ( Coordinate $coordinate, Location\Distance\DistanceInterface $calculator ) : float Calculates the distance between the given coordinate and this coordinate.
getEllipsoid ( ) : Ellipsoid
getLat ( ) : float
getLng ( ) : float
getPoints ( ) : array Returns an array containing the point

Méthodes protégées

Méthode Description
isNumericInBounds ( float $value, float $lower, float $upper ) : boolean Checks if the given value is (1) numeric, and (2) between lower and upper bounds (including the bounds values).
isValidLatitude ( mixed $latitude ) : boolean Validates latitude
isValidLongitude ( mixed $longitude ) : boolean Validates longitude

Method Details

__construct() public méthode

public __construct ( float $lat, float $lng, Ellipsoid $ellipsoid = null )
$lat float -90.0 .. +90.0
$lng float -180.0 .. +180.0
$ellipsoid Ellipsoid if omitted, WGS-84 is used

format() public méthode

public format ( Location\Formatter\Coordinate\FormatterInterface $formatter ) : mixed
$formatter Location\Formatter\Coordinate\FormatterInterface
Résultat mixed

getDistance() public méthode

Calculates the distance between the given coordinate and this coordinate.
public getDistance ( Coordinate $coordinate, Location\Distance\DistanceInterface $calculator ) : float
$coordinate Coordinate
$calculator Location\Distance\DistanceInterface instance of distance calculation class
Résultat float

getEllipsoid() public méthode

public getEllipsoid ( ) : Ellipsoid
Résultat Ellipsoid

getLat() public méthode

public getLat ( ) : float
Résultat float

getLng() public méthode

public getLng ( ) : float
Résultat float

getPoints() public méthode

Returns an array containing the point
public getPoints ( ) : array
Résultat array

isNumericInBounds() protected méthode

Checks if the given value is (1) numeric, and (2) between lower and upper bounds (including the bounds values).
protected isNumericInBounds ( float $value, float $lower, float $upper ) : boolean
$value float
$lower float
$upper float
Résultat boolean

isValidLatitude() protected méthode

Validates latitude
protected isValidLatitude ( mixed $latitude ) : boolean
$latitude mixed
Résultat boolean

isValidLongitude() protected méthode

Validates longitude
protected isValidLongitude ( mixed $longitude ) : boolean
$longitude mixed
Résultat boolean

Property Details

$ellipsoid protected_oe property

protected Ellipsoid,location $ellipsoid
Résultat Ellipsoid

$lat protected_oe property

protected float $lat
Résultat float

$lng protected_oe property

protected float $lng
Résultat float