diff --git a/src/Engine/DatabaseEngine.php b/src/Engine/DatabaseEngine.php index 829eee86..b7aa917e 100644 --- a/src/Engine/DatabaseEngine.php +++ b/src/Engine/DatabaseEngine.php @@ -394,4 +394,12 @@ public function maxDistance(Geometry $a, Geometry $b) { return $this->queryFloat('ST_MaxDistance', [$a, $b]); } + + /** + * {@inheritdoc} + */ + public function boundingPolygons(Geometry $g) + { + throw GeometryEngineException::unimplementedMethod(__METHOD__); + } } diff --git a/src/Engine/GEOSEngine.php b/src/Engine/GEOSEngine.php index 25057566..58ca399c 100644 --- a/src/Engine/GEOSEngine.php +++ b/src/Engine/GEOSEngine.php @@ -453,4 +453,12 @@ public function maxDistance(Geometry $a, Geometry $b) { throw GeometryEngineException::unimplementedMethod(__METHOD__); } + + /** + * {@inheritdoc} + */ + public function boundingPolygons(Geometry $g) + { + throw GeometryEngineException::unimplementedMethod(__METHOD__); + } } diff --git a/src/Engine/GeometryEngine.php b/src/Engine/GeometryEngine.php index d48dfbaa..6b54390d 100644 --- a/src/Engine/GeometryEngine.php +++ b/src/Engine/GeometryEngine.php @@ -378,4 +378,15 @@ public function simplify(Geometry $g, $tolerance); * @throws GeometryEngineException If the operation is not supported by the engine. */ public function maxDistance(Geometry $a, Geometry $b); + + /** + * Returns the collection of polygons that bounds the given polygon 'p' for any polygon 'p' in the surface. + * + * @param Geometry $g + * + * @return Geometry + * + * @throws GeometryEngineException If the operation is not supported by the engine. + */ + public function boundingPolygons(Geometry $g); } diff --git a/src/Exception/GeometryEngineException.php b/src/Exception/GeometryEngineException.php index 4fcf5afb..7413bd68 100644 --- a/src/Exception/GeometryEngineException.php +++ b/src/Exception/GeometryEngineException.php @@ -17,6 +17,18 @@ public static function noEngineSet() return new self('A GeometryEngine must be set to support this feature.'); } + /** + * @param string $methodName + * + * @return GeometryEngineException + */ + public static function unimplementedMethod($methodName) + { + $message = sprintf('%s() is currently not implemented.', $methodName); + + return new self($message); + } + /** * @param \Exception $e * diff --git a/src/Exception/GeometryException.php b/src/Exception/GeometryException.php index d9328f86..f0c49240 100644 --- a/src/Exception/GeometryException.php +++ b/src/Exception/GeometryException.php @@ -17,18 +17,6 @@ public static function unsupportedPlatform() return new self('This platform has an unsupported endianness.'); } - /** - * @param string $methodName - * - * @return GeometryException - */ - public static function unimplementedMethod($methodName) - { - $message = sprintf('%s() is currently not implemented.', $methodName); - - return new static($message); - } - /** * @param string $geometryType * diff --git a/src/PolyhedralSurface.php b/src/PolyhedralSurface.php index eae3aeff..3d0a16bf 100644 --- a/src/PolyhedralSurface.php +++ b/src/PolyhedralSurface.php @@ -120,19 +120,17 @@ public function patches() /** * Returns the collection of polygons in this surface that bounds the given polygon 'p' for any polygon 'p' in the surface. * - * @todo needs implementation - * * @noproxy * * @param Polygon $p * * @return MultiPolygon * - * @throws GeometryException + * @throws GeometryEngineException If the operation is not supported by the geometry engine. */ public function boundingPolygons(Polygon $p) { - throw GeometryException::unimplementedMethod(__METHOD__); + return GeometryEngineRegistry::get()->boundingPolygons($p); } /**