private function queryGeometry(string $function, ...$parameters) : Geometry
    {
        [$wkt, $wkb, $geometryType, $srid] = $this->query($function, $parameters, true);

        $srid = (int) $srid;

        if ($wkt !== null) {
            if ($this->useProxy) {
                $proxyClassName = $this->getProxyClassName($geometryType);

                return new $proxyClassName($wkt, false, $srid);
            }

            return Geometry::fromText($wkt, $srid);
        }

        if ($wkb !== null) {
            if (is_resource($wkb)) {
                $wkb = stream_get_contents($wkb);
            }

            if ($this->useProxy) {
                $proxyClassName = $this->getProxyClassName($geometryType);

                return new $proxyClassName($wkb, true, $srid);
            }

            return Geometry::fromBinary($wkb, $srid);
        }

        throw GeometryEngineException::operationYieldedNoResult();
    }
private function queryGeometry(string $function, ...$parameters) : Geometry
    {
        [$wkt, $wkb, $geometryType, $srid] = $this->query($function, $parameters, true);

        $srid = (int) $srid;

        if ($wkt !== null) {
            if ($this->useProxy) {
                $proxyClassName = $this->getProxyClassName($geometryType);

                return new $proxyClassName($wkt, false, $srid);
            }

            return Geometry::fromText($wkt, $srid);
        }

        if ($wkb !== null) {
            if (is_resource($wkb)) {
                $wkb = stream_get_contents($wkb);
            }

            if ($this->useProxy) {
                $proxyClassName = $this->getProxyClassName($geometryType);

                return new $proxyClassName($wkb, true, $srid);
            }

            return Geometry::fromBinary($wkb, $srid);
        }

        throw GeometryEngineException::operationYieldedNoResult();
    }
private function queryGeometry ( string $ function , ... $ parameters ) : Geometry { [ $ wkt , $ wkb , $ geometryType , $ srid ] = $ this -> query ( $ function , $ parameters , true ) ; $ srid = ( int ) $ srid ; if ( $ wkt !== null ) { if ( $ this -> useProxy ) { $ proxyClassName = $ this -> getProxyClassName ( $ geometryType ) ; return new $ proxyClassName ( $ wkt , false , $ srid ) ; } return Geometry :: fromText ( $ wkt , $ srid ) ; } if ( $ wkb !== null ) { if ( is_resource ( $ wkb ) ) { $ wkb = stream_get_contents ( $ wkb ) ; } if ( $ this -> useProxy ) { $ proxyClassName = $ this -> getProxyClassName ( $ geometryType ) ; return new $ proxyClassName ( $ wkb , true , $ srid ) ; } return Geometry :: fromBinary ( $ wkb , $ srid ) ; } throw GeometryEngineException :: operationYieldedNoResult ( ) ; }
Queries a GIS function returning a Geometry object.

@param string   $function   The SQL GIS function to execute.
@param mixed ...$parameters The Geometry objects or scalar values to pass as parameters.

@return Geometry

@throws GeometryEngineException
Queries a GIS function returning a Geometry object .