Skip to content

Commit 08a24d9

Browse files
committed
Add geosop minAreaRectangle op
1 parent bdceea6 commit 08a24d9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

util/geosop/GeometryOp.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <geos/algorithm/construct/LargestEmptyCircle.h>
2828
#include <geos/algorithm/construct/MaximumInscribedCircle.h>
2929
#include <geos/algorithm/BoundaryNodeRule.h>
30+
#include <geos/algorithm/MinimumAreaRectangle.h>
3031
#include <geos/algorithm/MinimumDiameter.h>
3132
#include <geos/algorithm/MinimumBoundingCircle.h>
3233
#include <geos/algorithm/distance/DiscreteHausdorffDistance.h>
@@ -404,6 +405,14 @@ std::vector<GeometryOpCreator> opRegistry {
404405
return new Result( std::move(res) );
405406
});
406407
}},
408+
{"minAreaRectangle", [](std::string name) { return GeometryOp::create(name,
409+
catConst,
410+
"compute minimum-area rectangle enclosing geometry",
411+
[](const std::unique_ptr<Geometry>& geom) {
412+
std::unique_ptr<Geometry> res = geos::algorithm::MinimumAreaRectangle::getMinimumRectangle(geom.get());
413+
return new Result( std::move(res) );
414+
});
415+
}},
407416
{"minBoundingCircle", [](std::string name) { return GeometryOp::create(name,
408417
catConst,
409418
"compute minimum bounding circle of geometry",

0 commit comments

Comments
 (0)