[geos-commits] [SCM] GEOS branch main updated. 1e4d0b01fe307b347fb629793baf8488146d041b
git at osgeo.org
git at osgeo.org
Tue Mar 18 13:02:24 PDT 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 1e4d0b01fe307b347fb629793baf8488146d041b (commit)
from 969b0019dbadf2095e21fa2a868cbf1e6e3b5ff8 (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 1e4d0b01fe307b347fb629793baf8488146d041b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Tue Mar 18 13:01:55 2025 -0700
Use shorter class names where possible in CAPI
diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index ace450b49..d7545469d 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -194,6 +194,8 @@ using geos::geom::PrecisionModel;
using geos::geom::SimpleCurve;
using geos::geom::Surface;
+using geos::geom::prep::PreparedGeometry;
+
using geos::io::WKTReader;
using geos::io::WKTWriter;
using geos::io::WKBReader;
@@ -2069,8 +2071,6 @@ extern "C" {
int
GEOSGeomGetM_r(GEOSContextHandle_t extHandle, const Geometry* g1, double* m)
{
- using geos::geom::Point;
-
return execute(extHandle, 0, [&]() {
const Point* po = dynamic_cast<const Point*>(g1);
if(!po) {
@@ -3252,8 +3252,6 @@ extern "C" {
GEOSGeom_setPrecision_r(GEOSContextHandle_t extHandle, const GEOSGeometry* g,
double gridSize, int flags)
{
- using namespace geos::geom;
-
return execute(extHandle, [&]() {
PrecisionModel newpm;
if(gridSize != 0) {
@@ -3286,8 +3284,6 @@ extern "C" {
double
GEOSGeom_getPrecision_r(GEOSContextHandle_t extHandle, const GEOSGeometry* g)
{
- using namespace geos::geom;
-
return execute(extHandle, -1.0, [&]() {
const PrecisionModel* pm = g->getPrecisionModel();
double cursize = pm->isFloating() ? 0 : 1.0 / pm->getScale();
@@ -3382,10 +3378,8 @@ extern "C" {
Geometry*
GEOSSimplify_r(GEOSContextHandle_t extHandle, const Geometry* g1, double tolerance)
{
- using namespace geos::simplify;
-
return execute(extHandle, [&]() {
- Geometry::Ptr g3(DouglasPeuckerSimplifier::simplify(g1, tolerance));
+ Geometry::Ptr g3(geos::simplify::DouglasPeuckerSimplifier::simplify(g1, tolerance));
g3->setSRID(g1->getSRID());
return g3.release();
});
@@ -3394,10 +3388,8 @@ extern "C" {
Geometry*
GEOSTopologyPreserveSimplify_r(GEOSContextHandle_t extHandle, const Geometry* g1, double tolerance)
{
- using namespace geos::simplify;
-
return execute(extHandle, [&]() {
- Geometry::Ptr g3(TopologyPreservingSimplifier::simplify(g1, tolerance));
+ Geometry::Ptr g3(geos::simplify::TopologyPreservingSimplifier::simplify(g1, tolerance));
g3->setSRID(g1->getSRID());
return g3.release();
});
@@ -3752,7 +3744,7 @@ extern "C" {
// Prepared Geometry
//-----------------------------------------------------------------
- const geos::geom::prep::PreparedGeometry*
+ const PreparedGeometry*
GEOSPrepare_r(GEOSContextHandle_t extHandle, const Geometry* g)
{
return execute(extHandle, [&]() {
@@ -3761,7 +3753,7 @@ extern "C" {
}
void
- GEOSPreparedGeom_destroy_r(GEOSContextHandle_t extHandle, const geos::geom::prep::PreparedGeometry* a)
+ GEOSPreparedGeom_destroy_r(GEOSContextHandle_t extHandle, const PreparedGeometry* a)
{
execute(extHandle, [&]() {
delete a;
@@ -3770,7 +3762,7 @@ extern "C" {
char
GEOSPreparedContains_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->contains(g);
@@ -3779,7 +3771,7 @@ extern "C" {
char
GEOSPreparedContainsXY_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, double x, double y)
+ const PreparedGeometry* pg, double x, double y)
{
extHandle->point2d->setXY(x, y);
@@ -3788,7 +3780,7 @@ extern "C" {
char
GEOSPreparedContainsProperly_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->containsProperly(g);
@@ -3797,7 +3789,7 @@ extern "C" {
char
GEOSPreparedCoveredBy_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->coveredBy(g);
@@ -3806,7 +3798,7 @@ extern "C" {
char
GEOSPreparedCovers_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->covers(g);
@@ -3815,7 +3807,7 @@ extern "C" {
char
GEOSPreparedCrosses_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->crosses(g);
@@ -3824,7 +3816,7 @@ extern "C" {
char
GEOSPreparedDisjoint_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->disjoint(g);
@@ -3833,7 +3825,7 @@ extern "C" {
char
GEOSPreparedIntersects_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->intersects(g);
@@ -3842,7 +3834,7 @@ extern "C" {
char
GEOSPreparedIntersectsXY_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, double x, double y)
+ const PreparedGeometry* pg, double x, double y)
{
extHandle->point2d->setXY(x, y);
@@ -3851,7 +3843,7 @@ extern "C" {
char
GEOSPreparedOverlaps_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->overlaps(g);
@@ -3860,7 +3852,7 @@ extern "C" {
char
GEOSPreparedTouches_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->touches(g);
@@ -3869,7 +3861,7 @@ extern "C" {
char
GEOSPreparedWithin_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, 2, [&]() {
return pg->within(g);
@@ -3878,7 +3870,7 @@ extern "C" {
char *
GEOSPreparedRelate_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
return execute(extHandle, [&]() -> char * {
return gstrdup(pg->relate(g)->toString());
@@ -3887,7 +3879,7 @@ extern "C" {
char
GEOSPreparedRelatePattern_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g, const char* imPattern)
+ const PreparedGeometry* pg, const Geometry* g, const char* imPattern)
{
return execute(extHandle, 2, [&]() {
return pg->relate(g, std::string(imPattern));
@@ -3896,18 +3888,16 @@ extern "C" {
CoordinateSequence*
GEOSPreparedNearestPoints_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg, const Geometry* g)
+ const PreparedGeometry* pg, const Geometry* g)
{
- using namespace geos::geom;
-
- return execute(extHandle, [&]() -> CoordinateSequence* {
+ return execute(extHandle, [&]() -> geos::geom::CoordinateSequence* {
return pg->nearestPoints(g).release();
});
}
int
GEOSPreparedDistance_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg,
+ const PreparedGeometry* pg,
const Geometry* g, double* dist)
{
return execute(extHandle, 0, [&]() {
@@ -3918,7 +3908,7 @@ extern "C" {
char
GEOSPreparedDistanceWithin_r(GEOSContextHandle_t extHandle,
- const geos::geom::prep::PreparedGeometry* pg,
+ const PreparedGeometry* pg,
const Geometry* g, double dist)
{
return execute(extHandle, 2, [&]() {
@@ -3952,7 +3942,7 @@ extern "C" {
void
GEOSSTRtree_insert_r(GEOSContextHandle_t extHandle,
GEOSSTRtree* tree,
- const geos::geom::Geometry* g,
+ const Geometry* g,
void* item)
{
execute(extHandle, [&]() {
@@ -3963,7 +3953,7 @@ extern "C" {
void
GEOSSTRtree_query_r(GEOSContextHandle_t extHandle,
GEOSSTRtree* tree,
- const geos::geom::Geometry* g,
+ const Geometry* g,
GEOSQueryCallback callback,
void* userdata)
{
@@ -3976,7 +3966,7 @@ extern "C" {
const GEOSGeometry*
GEOSSTRtree_nearest_r(GEOSContextHandle_t extHandle,
GEOSSTRtree* tree,
- const geos::geom::Geometry* geom)
+ const Geometry* geom)
{
return (const GEOSGeometry*) GEOSSTRtree_nearest_generic_r(extHandle, tree, geom, geom, nullptr, nullptr);
}
@@ -3985,12 +3975,10 @@ extern "C" {
GEOSSTRtree_nearest_generic_r(GEOSContextHandle_t extHandle,
GEOSSTRtree* tree,
const void* item,
- const geos::geom::Geometry* itemEnvelope,
+ const Geometry* itemEnvelope,
GEOSDistanceCallback distancefn,
void* userdata)
{
- using namespace geos::index::strtree;
-
struct CustomItemDistance {
CustomItemDistance(GEOSDistanceCallback p_distancefn, void* p_userdata)
: m_distancefn(p_distancefn), m_userdata(p_userdata) {}
@@ -4042,7 +4030,7 @@ extern "C" {
char
GEOSSTRtree_remove_r(GEOSContextHandle_t extHandle,
GEOSSTRtree* tree,
- const geos::geom::Geometry* g,
+ const Geometry* g,
void* item) {
return execute(extHandle, 2, [&]() {
return tree->remove(g->getEnvelopeInternal(), item);
@@ -4064,7 +4052,7 @@ extern "C" {
const Geometry* p)
{
return execute(extHandle, -1.0, [&]() {
- const geos::geom::Point* point = dynamic_cast<const geos::geom::Point*>(p);
+ const Point* point = dynamic_cast<const Point*>(p);
if(!point) {
throw std::runtime_error("third argument of GEOSProject_r must be Point");
}
@@ -4130,13 +4118,10 @@ extern "C" {
GEOSGeom_extractUniquePoints_r(GEOSContextHandle_t extHandle,
const GEOSGeometry* g)
{
- using namespace geos::geom;
- using namespace geos::util;
-
return execute(extHandle, [&]() {
/* 1: extract points */
std::vector<const Coordinate*> coords;
- UniqueCoordinateArrayFilter filter(coords);
+ geos::util::UniqueCoordinateArrayFilter filter(coords);
g->apply_ro(&filter);
/* 2: for each point, create a geometry and put into a vector */
@@ -4161,20 +4146,18 @@ extern "C" {
int GEOSOrientationIndex_r(GEOSContextHandle_t extHandle,
double Ax, double Ay, double Bx, double By, double Px, double Py)
{
- using geos::algorithm::Orientation;
-
return execute(extHandle, 2, [&]() {
Coordinate A(Ax, Ay);
Coordinate B(Bx, By);
Coordinate P(Px, Py);
- return Orientation::index(A, B, P);
+ return geos::algorithm::Orientation::index(A, B, P);
});
}
GEOSGeometry*
GEOSSharedPaths_r(GEOSContextHandle_t extHandle, const GEOSGeometry* g1, const GEOSGeometry* g2)
{
- using namespace geos::operation::sharedpaths;
+ using geos::operation::sharedpaths::SharedPathsOp;
if(nullptr == extHandle) {
return nullptr;
@@ -4245,10 +4228,8 @@ extern "C" {
GEOSSnap_r(GEOSContextHandle_t extHandle, const GEOSGeometry* g1,
const GEOSGeometry* g2, double tolerance)
{
- using namespace geos::operation::overlay::snap;
-
return execute(extHandle, [&]() {
- GeometrySnapper snapper(*g1);
+ geos::operation::overlay::snap::GeometrySnapper snapper(*g1);
std::unique_ptr<Geometry> ret = snapper.snapTo(*g2, tolerance);
ret->setSRID(g1->getSRID());
return ret.release();
-----------------------------------------------------------------------
Summary of changes:
capi/geos_ts_c.cpp | 87 +++++++++++++++++++++---------------------------------
1 file changed, 34 insertions(+), 53 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list