class Coordinates implements CoordinatesInterface

Properties

private float $latitude
private float $longitude
protected Ellipsoid $ellipsoid

The selected ellipsoid.

protected $precision

Methods

__construct(float $latitude, float $longitude, Ellipsoid $ellipsoid = null)

No description

setLatitude(float $latitude)

Set the latitude.

setLongitude(float $longitude)

Set the longitude.

$this
setPrecision(int $precision)

No description

float
getLatitude()

Returns the latitude.

float
getLongitude()

Returns the longitude.

float
formatLatitude()

Returns the latitude.

float
formatLongitude()

Returns the longitude.

getEllipsoid()

Get the Ellipsoid.

int
getPrecision()

No description

bool
isEqual(CoordinatesInterface $coordinate)

Returns a boolean determining coordinates equality

float
normalizeLatitude(float $latitude)

Normalizes a latitude to the (-90, 90) range.

float
normalizeLongitude(float $longitude)

Normalizes a longitude to the (-180, 180) range.

array
toArray()

Returns the coordinates as a tuple

string
typeToString($value)

No description

Details

at line 33
__construct(float $latitude, float $longitude, Ellipsoid $ellipsoid = null)

No description

Parameters

float $latitude
float $longitude
Ellipsoid $ellipsoid

at line 46
setLatitude(float $latitude)

Set the latitude.

Parameters

float $latitude

at line 56
setLongitude(float $longitude)

Set the longitude.

Parameters

float $longitude

at line 65
$this setPrecision(int $precision)

No description

Parameters

int $precision

Return Value

$this

at line 77
float getLatitude()

Returns the latitude.

Return Value

float

at line 87
float getLongitude()

Returns the longitude.

Return Value

float

at line 97
float formatLatitude()

Returns the latitude.

Return Value

float

at line 107
float formatLongitude()

Returns the longitude.

Return Value

float

at line 115
Ellipsoid getEllipsoid()

Get the Ellipsoid.

Return Value

Ellipsoid

at line 123
int getPrecision()

No description

Return Value

int

at line 133
bool isEqual(CoordinatesInterface $coordinate)

Returns a boolean determining coordinates equality

Parameters

CoordinatesInterface $coordinate

Return Value

bool

at line 147
float normalizeLatitude(float $latitude)

Normalizes a latitude to the (-90, 90) range.

Latitudes below -90.0 or above 90.0 degrees are capped, not wrapped.

Parameters

float $latitude

The latitude to normalize

Return Value

float

at line 160
float normalizeLongitude(float $longitude)

Normalizes a longitude to the (-180, 180) range.

Longitudes below -180.0 or abode 180.0 degrees are wrapped.

Parameters

float $longitude

The longitude to normalize

Return Value

float

at line 177
array toArray()

Returns the coordinates as a tuple

Return Value

array

at line 182
protected string typeToString($value)

No description

Parameters

$value

Return Value

string