League\Geotools\Convert\Convert::toDecimalMinutes PHP Method

toDecimalMinutes() public method

{@inheritDoc}
public toDecimalMinutes ( $format = ConvertInterface::DEFAULT_DM_FORMAT )
    public function toDecimalMinutes($format = ConvertInterface::DEFAULT_DM_FORMAT)
    {
        $latitude = $this->parseCoordinate($this->coordinates->getLatitude());
        $longitude = $this->parseCoordinate($this->coordinates->getLongitude());
        return strtr($format, array(ConvertInterface::LATITUDE_SIGN => $latitude['positive'] ? '' : '-', ConvertInterface::LATITUDE_DIRECTION => $latitude['positive'] ? 'N' : 'S', ConvertInterface::LATITUDE_DEGREES => $latitude['degrees'], ConvertInterface::LATITUDE_DECIMAL_MINUTES => $latitude['decimalMinutes'], ConvertInterface::LONGITUDE_SIGN => $longitude['positive'] ? '' : '-', ConvertInterface::LONGITUDE_DIRECTION => $longitude['positive'] ? 'E' : 'W', ConvertInterface::LONGITUDE_DEGREES => $longitude['degrees'], ConvertInterface::LONGITUDE_DECIMAL_MINUTES => $longitude['decimalMinutes']));
    }

Usage Example

 /**
  * Returns a decimal minutes representation of the coordinate
  *
  * @return StringLiteral
  */
 public function toDecimalMinutes()
 {
     $coordinate = static::getBaseCoordinate($this);
     $convert = new Convert($coordinate);
     $dm = $convert->toDecimalMinutes();
     return new StringLiteral($dm);
 }