League\Geotools\Coordinate\Coordinate::setFromString PHP Method

setFromString() public method

Creates a valid and acceptable geographic coordinates.
public setFromString ( string $coordinates )
$coordinates string
    public function setFromString($coordinates)
    {
        if (!is_string($coordinates)) {
            throw new InvalidArgumentException('The given coordinates should be a string !');
        }
        try {
            $inDecimalDegree = $this->toDecimalDegrees($coordinates);
            $this->setLatitude($inDecimalDegree[0]);
            $this->setLongitude($inDecimalDegree[1]);
        } catch (InvalidArgumentException $e) {
            throw $e;
        }
    }