diff --git a/util/geosop/GeometryOp.cpp b/util/geosop/GeometryOp.cpp index d55d7b88f..1e2dbf52b 100644 --- a/util/geosop/GeometryOp.cpp +++ b/util/geosop/GeometryOp.cpp @@ -303,6 +303,26 @@ std::vector opRegistry { return new Result( geom->buffer( d, quadrantSegments ) ); }); }}, +{"bufferJoin", [](std::string name) { return GeometryOp::create(name, + catConst, + "compute the buffer of geometry by a distance, with join >0 = QS, 0 = Bevel, <0 = Mitre limit", + [](const std::unique_ptr& geom, double d, int join) { + geos::operation::buffer::BufferParameters param; + if (join > 0) { + param.setQuadrantSegments( join ); + param.setJoinStyle(geos::operation::buffer::BufferParameters::JOIN_ROUND); + } + else if (join == 0) { + param.setJoinStyle(geos::operation::buffer::BufferParameters::JOIN_BEVEL); + } + else if (join < 0) { + param.setJoinStyle(geos::operation::buffer::BufferParameters::JOIN_MITRE); + param.setMitreLimit( -join ); + } + std::unique_ptr g3 = geos::operation::buffer::BufferOp::bufferOp(geom.get(), d, param); + return new Result( g3.release() ); + }); + }}, {"offsetCurve", [](std::string name) { return GeometryOp::create(name, catConst, "compute the offset curve of geometry by a distance", @@ -312,6 +332,27 @@ std::vector opRegistry { return new Result( g3.release() ); }); }}, +{"offsetCurveJoin", [](std::string name) { return GeometryOp::create(name, + catConst, + "compute the offset curve of geometry by a distance, with join >0 = QS, 0 = Bevel, <0 = Mitre limit", + [](const std::unique_ptr& geom, double d, int join) { + int quadSegs = 0; + geos::operation::buffer::BufferParameters::JoinStyle joinStyle = geos::operation::buffer::BufferParameters::JOIN_ROUND; + double miterLimit = 0; + if (join > 0) { + quadSegs = join; + } + else if (join == 0) { + joinStyle = geos::operation::buffer::BufferParameters::JOIN_BEVEL; + } + else if (join < 0) { + joinStyle = geos::operation::buffer::BufferParameters::JOIN_MITRE; + miterLimit = -join; + } + std::unique_ptr g3 = geos::operation::buffer::OffsetCurve::getCurve(*geom, d, quadSegs, joinStyle, miterLimit); + return new Result( g3.release() ); + }); + }}, {"OLDoffsetCurve", [](std::string name) { return GeometryOp::create(name, catConst, "compute the offset curve of geometry by a distance",