/** * {@inheritdoc} */ public function getIterator() { if ($this->proxyGeometry === null) { $this->load(); } return $this->proxyGeometry->getIterator(); }
/** * Class constructor. * * The coordinate system of each of the rings must match the one of the Polygon. * * @param CoordinateSystem $cs The coordinate system of the Polygon. * @param LineString ...$rings The rings that compose the Polygon, the first one being the exterior ring. * * @throws InvalidGeometryException If the resulting geometry is not valid for a sub-type of Polygon. * @throws CoordinateSystemException If different coordinate systems are used. */ public function __construct(CoordinateSystem $cs, LineString ...$rings) { parent::__construct($cs, !$rings); if (!$rings) { return; } CoordinateSystem::check($this, ...$rings); $this->rings = $rings; }
/** * Class constructor. * * The coordinate system of each of the patches must match the one of the PolyhedralSurface. * * @param CoordinateSystem $cs The coordinate system of the PolyhedralSurface. * @param Polygon ...$patches The patches that compose the PolyhedralSurface. * * @throws CoordinateSystemException If different coordinate systems are used. */ public function __construct(CoordinateSystem $cs, Polygon ...$patches) { parent::__construct($cs, !$patches); if (!$patches) { return; } CoordinateSystem::check($this, ...$patches); $this->patches = $patches; }
/** * @dataProvider providerPointOnSurface * * @param string $surface The WKT of the Surface to test. */ public function testPointOnSurface($surface) { $this->requiresGeometryEngine(); if ($this->isMySQL() || $this->isMariaDB()) { // MySQL and MariaDB do not support ST_PointOnSurface() $this->setExpectedException(GeometryEngineException::class); } $surface = Surface::fromText($surface); $this->skipIfUnsupportedGeometry($surface); $pointOnSurface = $surface->pointOnSurface(); $this->assertInstanceOf(Point::class, $pointOnSurface); $this->assertTrue($surface->contains($pointOnSurface)); }