[geos-commits] [SCM] GEOS branch main updated. fa6714ecd4fe5ec660f25114a2f2af0f4738c14a
git at osgeo.org
git at osgeo.org
Tue Feb 4 10:41:28 PST 2025
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 fa6714ecd4fe5ec660f25114a2f2af0f4738c14a (commit)
from badff59336873984c640a641f679946dd25fcf1c (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 fa6714ecd4fe5ec660f25114a2f2af0f4738c14a
Author: Martin Davis <mtnclimb at gmail.com>
Date: Tue Feb 4 10:40:55 2025 -0800
Add geosop orientationIndex op
diff --git a/util/geosop/GeometryOp.cpp b/util/geosop/GeometryOp.cpp
index a52ff058e..a0d176e6c 100644
--- a/util/geosop/GeometryOp.cpp
+++ b/util/geosop/GeometryOp.cpp
@@ -24,6 +24,7 @@
#include <geos/geom/GeometryFactory.h>
#include <geos/geom/prep/PreparedGeometry.h>
#include <geos/geom/prep/PreparedGeometryFactory.h>
+#include <geos/algorithm/Orientation.h>
#include <geos/algorithm/construct/LargestEmptyCircle.h>
#include <geos/algorithm/construct/MaximumInscribedCircle.h>
#include <geos/algorithm/BoundaryNodeRule.h>
@@ -802,6 +803,18 @@ std::vector<GeometryOpCreator> opRegistry {
return new Result( prepGeomCache.get(geom.get())->intersects( geomB.get() ) );
});
}},
+{ "orientationIndex", [](std::string name) { return GeometryOp::create(name,
+ catRel, "orientation index for a line segment and a point",
+ Result::typeInt,
+ [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB) {
+ std::unique_ptr<CoordinateSequence> seqA = geom->getCoordinates();
+ Coordinate p0 = seqA->getAt(0);
+ Coordinate p1 = seqA->getAt(1);
+ std::unique_ptr<CoordinateSequence> seqB = geomB->getCoordinates();
+ Coordinate q = seqB->getAt(0);
+ return new Result( algorithm::Orientation::index(p0, p1, q) );
+ });
+}},
//============= category: Overlay ==================
-----------------------------------------------------------------------
Summary of changes:
util/geosop/GeometryOp.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list