startPoint)) { $this->startPoint = $this->pointN(1); } return $this->startPoint; } public function endPoint() { if (!isset($this->endPoint)) { $this->endPoint = $this->pointN($this->numPoints()); } return $this->endPoint; } public function isClosed() { return ($this->startPoint() && $this->endPoint() ? $this->startPoint()->equals($this->endPoint()) : false); } public function isRing() { return ($this->isClosed() && $this->isSimple()); } /** * @return Point[] */ public function getPoints() { return $this->getComponents(); } /** * The boundary of a non-closed Curve consists of its end Points * * @return LineString|MultiPoint */ public function boundary() { return $this->isEmpty() ? new LineString() : ($this->isClosed() ? new MultiPoint() : new MultiPoint([$this->startPoint(), $this->endPoint()]) ); } // Not valid for this geometry type // -------------------------------- public function area() { return 0; } public function exteriorRing() { return null; } public function numInteriorRings() { return null; } public function interiorRingN($n) { return null; } }