Location\GeometryInterface::getPoints PHP Method

getPoints() public method

Returns an array containing all assigned points.
public getPoints ( ) : array
return array
    public function getPoints();

Usage Example

Beispiel #1
0
 /**
  * Determine if given geometry is contained inside the polygon. This is
  * assumed to be true, if each point of the geometry is inside the polygon.
  *
  * Edge cases:
  *
  * - it's not detected when a line between two points is outside the polygon
  * - @see contains() for more restrictions
  *
  * @param GeometryInterface $geometry
  *
  * @return boolean
  */
 public function containsGeometry(GeometryInterface $geometry)
 {
     $geometryInPolygon = true;
     /** @var Coordinate $point */
     foreach ($geometry->getPoints() as $point) {
         $geometryInPolygon = $geometryInPolygon && $this->contains($point);
     }
     return $geometryInPolygon;
 }
GeometryInterface