Skip to content

Commit

Permalink
C API: Delegate predicates to Geometry methods (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston authored Aug 15, 2024
1 parent 220df45 commit 3f9a70a
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions capi/geos_ts_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
#include <geos/operation/valid/RepeatedPointRemover.h>

#include <geos/operation/relateng/RelateNG.h>
#include <geos/operation/relateng/RelatePredicate.h>

#include <geos/precision/GeometryPrecisionReducer.h>
#include <geos/shape/fractal/HilbertEncoder.h>
Expand Down Expand Up @@ -210,7 +209,6 @@ using geos::operation::overlayng::OverlayNG;
using geos::operation::overlayng::UnaryUnionNG;
using geos::operation::overlayng::OverlayNGRobust;
using geos::operation::relateng::RelateNG;
using geos::operation::relateng::RelatePredicate;
using geos::operation::valid::TopologyValidationError;

using geos::precision::GeometryPrecisionReducer;
Expand Down Expand Up @@ -583,79 +581,79 @@ extern "C" {
GEOSDisjoint_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::disjoint(g1, g2);
return g1->disjoint(g2);
});
}

char
GEOSTouches_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::touches(g1, g2);
return g1->touches(g2);
});
}

char
GEOSIntersects_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::intersects(g1, g2);
return g1->intersects(g2);
});
}

char
GEOSCrosses_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::crosses(g1, g2);
return g1->crosses(g2);
});
}

char
GEOSWithin_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::within(g1, g2);
return g1->within(g2);
});
}

char
GEOSContains_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::contains(g1, g2);
return g1->contains(g2);
});
}

char
GEOSOverlaps_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::overlaps(g1, g2);
return g1->overlaps(g2);
});
}

char
GEOSCovers_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::covers(g1, g2);
return g1->covers(g2);
});
}

char
GEOSCoveredBy_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::coveredBy(g1, g2);
return g1->coveredBy(g2);
});
}

char
GEOSEquals_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2)
{
return execute(extHandle, 2, [&]() {
return RelateNG::equalsTopo(g1, g2);
return g1->equals(g2);
});
}

Expand Down

0 comments on commit 3f9a70a

Please sign in to comment.