/** * 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; }