[geos-commits] [SCM] GEOS branch main updated. ef8f6d974f4d4e8fed1b7f3263edb633da5c98fb
git at osgeo.org
git at osgeo.org
Tue Dec 10 15:51:28 PST 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, main has been updated
via ef8f6d974f4d4e8fed1b7f3263edb633da5c98fb (commit)
from dd0fdc59b9fd9aa7d0bc4eda9c16ff968e91815a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ef8f6d974f4d4e8fed1b7f3263edb633da5c98fb
Author: Martin Davis <mtnclimb at gmail.com>
Date: Tue Dec 10 15:50:59 2024 -0800
Add geosOp bufferJoin and offsetCurveJoin
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<GeometryOpCreator> 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<Geometry>& 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<Geometry> 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<GeometryOpCreator> 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<Geometry>& 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<Geometry> 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",
-----------------------------------------------------------------------
Summary of changes:
util/geosop/GeometryOp.cpp | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list