PHP Class ValueObjects\Geography\Coordinate

Inheritance: implements ValueObjects\ValueObjectInterface
Datei anzeigen Open project: nicolopignatelli/valueobjects Class Usage Examples

Protected Properties

Property Type Description
$ellipsoid ValueObjects\Geography\Ellipsoid
$latitude ValueObjects\Geography\Latitude
$longitude ValueObjects\Geography\Longitude

Public Methods

Method Description
__construct ( ValueObjects\Geography\Latitude $latitude, ValueObjects\Geography\Longitude $longitude, ValueObjects\Geography\Ellipsoid $ellipsoid = null ) Returns a new Coordinate object
__toString ( ) : string Returns a native string version of the Coordiantes object in format "$latitude,$longitude"
distanceFrom ( Coordinate $coordinate, ValueObjects\Geography\DistanceUnit $unit = null, ValueObjects\Geography\DistanceFormula $formula = null ) : ValueObjects\Number\Real Calculates the distance between two Coordinate objects
fromNative ( ) : self Returns a new Coordinate object from native PHP arguments
getEllipsoid ( ) : ValueObjects\Geography\Ellipsoid Returns ellipsoid
getLatitude ( ) : ValueObjects\Geography\Latitude Returns latitude
getLongitude ( ) : ValueObjects\Geography\Longitude Returns longitude
sameValueAs ( ValueObjects\ValueObjectInterface $coordinate ) : boolean Tells whether tow Coordinate objects are equal
toDecimalMinutes ( ) : ValueObjects\StringLiteral\StringLiteral Returns a decimal minutes representation of the coordinate
toDegreesMinutesSeconds ( ) : ValueObjects\StringLiteral\StringLiteral Returns a degrees/minutes/seconds representation of the coordinate
toUniversalTransverseMercator ( ) : ValueObjects\StringLiteral\StringLiteral Returns a Universal Transverse Mercator projection representation of the coordinate in meters

Protected Methods

Method Description
getBaseCoordinate ( self $coordinate ) : Coordinate Returns the underlying Coordinate object

Method Details

__construct() public method

Returns a new Coordinate object
public __construct ( ValueObjects\Geography\Latitude $latitude, ValueObjects\Geography\Longitude $longitude, ValueObjects\Geography\Ellipsoid $ellipsoid = null )
$latitude ValueObjects\Geography\Latitude
$longitude ValueObjects\Geography\Longitude
$ellipsoid ValueObjects\Geography\Ellipsoid

__toString() public method

Returns a native string version of the Coordiantes object in format "$latitude,$longitude"
public __toString ( ) : string
return string

distanceFrom() public method

Calculates the distance between two Coordinate objects
public distanceFrom ( Coordinate $coordinate, ValueObjects\Geography\DistanceUnit $unit = null, ValueObjects\Geography\DistanceFormula $formula = null ) : ValueObjects\Number\Real
$coordinate Coordinate
$unit ValueObjects\Geography\DistanceUnit
$formula ValueObjects\Geography\DistanceFormula
return ValueObjects\Number\Real

fromNative() public static method

Returns a new Coordinate object from native PHP arguments
public static fromNative ( ) : self
return self

getBaseCoordinate() protected static method

Returns the underlying Coordinate object
protected static getBaseCoordinate ( self $coordinate ) : Coordinate
$coordinate self
return League\Geotools\Coordinate\Coordinate

getEllipsoid() public method

Returns ellipsoid
public getEllipsoid ( ) : ValueObjects\Geography\Ellipsoid
return ValueObjects\Geography\Ellipsoid

getLatitude() public method

Returns latitude
public getLatitude ( ) : ValueObjects\Geography\Latitude
return ValueObjects\Geography\Latitude

getLongitude() public method

Returns longitude
public getLongitude ( ) : ValueObjects\Geography\Longitude
return ValueObjects\Geography\Longitude

sameValueAs() public method

Tells whether tow Coordinate objects are equal
public sameValueAs ( ValueObjects\ValueObjectInterface $coordinate ) : boolean
$coordinate ValueObjects\ValueObjectInterface
return boolean

toDecimalMinutes() public method

Returns a decimal minutes representation of the coordinate
public toDecimalMinutes ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

toDegreesMinutesSeconds() public method

Returns a degrees/minutes/seconds representation of the coordinate
public toDegreesMinutesSeconds ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

toUniversalTransverseMercator() public method

Returns a Universal Transverse Mercator projection representation of the coordinate in meters
public toUniversalTransverseMercator ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

Property Details

$ellipsoid protected_oe property

protected Ellipsoid,ValueObjects\Geography $ellipsoid
return ValueObjects\Geography\Ellipsoid

$latitude protected_oe property

protected Latitude,ValueObjects\Geography $latitude
return ValueObjects\Geography\Latitude

$longitude protected_oe property

protected Longitude,ValueObjects\Geography $longitude
return ValueObjects\Geography\Longitude