ValueObjects\Geography\Coordinate::toDegreesMinutesSeconds PHP Method

toDegreesMinutesSeconds() public method

Returns a degrees/minutes/seconds representation of the coordinate
public toDegreesMinutesSeconds ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral
    public function toDegreesMinutesSeconds()
    {
        $coordinate = static::getBaseCoordinate($this);
        $convert = new Convert($coordinate);
        $dms = $convert->toDegreesMinutesSeconds();
        return new StringLiteral($dms);
    }

Usage Example

Example #1
0
 public function testToDegreesMinutesSeconds()
 {
     $dms = new StringLiteral('40°49′45″N, 16°33′21″E');
     $this->assertTrue($this->coordinate->toDegreesMinutesSeconds()->sameValueAs($dms));
 }