<?php
namespace League\Geotools\Polygon;
use League\Geotools\Coordinate\CoordinateInterface;
use League\Geotools\GeometryCollection;
class MultiPolygon extends GeometryCollection implements PolygonInterface
{
const TYPE = 'MULTIPOLYGON';
public function getGeometryType()
{
return self::TYPE;
}
public function pointInPolygon(CoordinateInterface $coordinate)
{
foreach ($this->elements as $polygon) {
if ($polygon->pointInPolygon($coordinate)) {
return true;
}
}
return false;
}
public function pointOnBoundary(CoordinateInterface $coordinate)
{
foreach ($this->elements as $polygon) {
if ($polygon->pointOnBoundary($coordinate)) {
return true;
}
}
return false;
}
public function pointOnVertex(CoordinateInterface $coordinate)
{
foreach ($this->elements as $polygon) {
if ($polygon->pointOnVertex($coordinate)) {
return true;
}
}
return false;
}
}