private function newObjectFromValue(AbstractSpatialType $type, $value)
    {
        $typeFamily = $type->getTypeFamily();
        $typeName   = strtoupper($value['type']);

        $constName = sprintf('CrEOF\Spatial\PHP\Types\Geometry\GeometryInterface::%s', $typeName);

        if (! defined($constName)) {
            // @codeCoverageIgnoreStart
            throw new InvalidValueException(sprintf('Unsupported %s type "%s".', $typeFamily, $typeName));
            // @codeCoverageIgnoreEnd
        }

        $class = sprintf('CrEOF\Spatial\PHP\Types\%s\%s', $typeFamily, constant($constName));

        return new $class($value['value'], $value['srid']);
    }
private function newObjectFromValue(AbstractSpatialType $type, $value)
    {
        $typeFamily = $type->getTypeFamily();
        $typeName   = strtoupper($value['type']);

        $constName = sprintf('CrEOF\Spatial\PHP\Types\Geometry\GeometryInterface::%s', $typeName);

        if (! defined($constName)) {
            // @codeCoverageIgnoreStart
            throw new InvalidValueException(sprintf('Unsupported %s type "%s".', $typeFamily, $typeName));
            // @codeCoverageIgnoreEnd
        }

        $class = sprintf('CrEOF\Spatial\PHP\Types\%s\%s', $typeFamily, constant($constName));

        return new $class($value['value'], $value['srid']);
    }
private function newObjectFromValue ( AbstractSpatialType $ type , $ value ) { $ typeFamily = $ type -> getTypeFamily ( ) ; $ typeName = strtoupper ( $ value [ 'type' ] ) ; $ constName = sprintf ( 'CrEOF\Spatial\PHP\Types\Geometry\GeometryInterface::%s' , $ typeName ) ; if ( ! defined ( $ constName ) ) { // @codeCoverageIgnoreStart throw new InvalidValueException ( sprintf ( 'Unsupported %s type "%s".' , $ typeFamily , $ typeName ) ) ; // @codeCoverageIgnoreEnd } $ class = sprintf ( 'CrEOF\Spatial\PHP\Types\%s\%s' , $ typeFamily , constant ( $ constName ) ) ; return new $ class ( $ value [ 'value' ] , $ value [ 'srid' ] ) ; }
Create spatial object from parsed value

@param AbstractSpatialType $type
@param array               $value

@return GeometryInterface
@throws \CrEOF\Spatial\Exception\InvalidValueException
Create spatial object from parsed value