Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function coordinateSystem()
 {
     if ($this->proxyGeometry === null) {
         $this->load();
     }
     return $this->proxyGeometry->coordinateSystem();
 }
Esempio n. 2
0
File: TIN.php Progetto: brick/geo
 /**
  * {@inheritdoc}
  *
  * @throws UnexpectedGeometryException If the patches are not triangles.
  */
 public function __construct(CoordinateSystem $cs, Polygon ...$patches)
 {
     parent::__construct($cs, ...$patches);
     foreach ($patches as $patch) {
         if (!$patch instanceof Triangle) {
             throw new UnexpectedGeometryException('The patches in a TIN must be triangles.');
         }
     }
 }
Esempio n. 3
0
 /**
  * Tests Countable and Traversable interfaces.
  */
 public function testInterfaces()
 {
     $polyhedralSurface = PolyhedralSurface::fromText('POLYHEDRALSURFACE(((0 0, 0 1, 1 1, 1 0, 0 0)), ((1 0, 1 1, 2 1, 2 0, 1 0)), ((2 0, 2 1, 3 1, 3 0, 2 0)))');
     $this->assertInstanceOf(\Countable::class, $polyhedralSurface);
     $this->assertSame(3, count($polyhedralSurface));
     $this->assertInstanceOf(\Traversable::class, $polyhedralSurface);
     $this->assertSame([$polyhedralSurface->patchN(1), $polyhedralSurface->patchN(2), $polyhedralSurface->patchN(3)], iterator_to_array($polyhedralSurface));
 }