/** * @dataProvider providerCreate * * @param string[] $curvesWKT The WKT of the Curves that compose the CompoundCurve. * @param boolean $is3D Whether the curves have Z coordinates. * @param boolean $isMeasured Whether the curves have M coordinates. * @param string $compoundCurveWKT The WKT of the expected CompoundCurve. */ public function testCreate(array $curvesWKT, $is3D, $isMeasured, $compoundCurveWKT) { foreach ([0, 1] as $srid) { $instantiateCurve = function ($curve) use($srid) { return Curve::fromText($curve, $srid); }; $cs = new CoordinateSystem($is3D, $isMeasured, $srid); $compoundCurve = new CompoundCurve($cs, ...array_map($instantiateCurve, $curvesWKT)); $this->assertWktEquals($compoundCurve, $compoundCurveWKT, $srid); } }
/** * Loads the underlying geometry. * * @return void * * @throws GeometryIOException If the proxy data is not valid. * @throws CoordinateSystemException If the resulting geometry contains mixed coordinate systems. * @throws InvalidGeometryException If the resulting geometry is not valid. * @throws UnexpectedGeometryException If the resulting geometry is not an instance of the proxied class. */ private function load() { $this->proxyGeometry = $this->proxyIsBinary ? Curve::fromBinary($this->proxyData, $this->proxySRID) : Curve::fromText($this->proxyData, $this->proxySRID); }
/** * @dataProvider providerIsRing * * @param string $curve The WKT of the Curve to test. * @param boolean $isRing Whether the Curve is a ring. */ public function testIsRing($curve, $isRing) { $this->requiresGeometryEngine(); $curve = Curve::fromText($curve); $this->skipIfUnsupportedGeometry($curve); if ($curve->isClosed() && $this->isMariaDB('< 10.1.4')) { // @see https://mariadb.atlassian.net/browse/MDEV-7510 $this->markTestSkipped('A bug in MariaDB returns the wrong result.'); } $this->assertSame($isRing, $curve->isRing()); }