コード例 #1
0
ファイル: CompoundCurveProxy.php プロジェクト: brick/geo
 /**
  * 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 ? CompoundCurve::fromBinary($this->proxyData, $this->proxySRID) : CompoundCurve::fromText($this->proxyData, $this->proxySRID);
 }
コード例 #2
0
ファイル: CompoundCurveTest.php プロジェクト: brick/geo
 /**
  * Tests Countable and Traversable interfaces.
  */
 public function testInterfaces()
 {
     $compoundCurve = CompoundCurve::fromText('COMPOUNDCURVE (CIRCULARSTRING(1 2, 3 4, 5 6), (5 6, 7 8))');
     $this->assertInstanceOf(\Countable::class, $compoundCurve);
     $this->assertSame(2, count($compoundCurve));
     $this->assertInstanceOf(\Traversable::class, $compoundCurve);
     $this->assertSame([$compoundCurve->curveN(1), $compoundCurve->curveN(2)], iterator_to_array($compoundCurve));
 }