Skip to content

Commit

Permalink
Improve C API DE-9IM parameter names
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Aug 13, 2024
1 parent dfdaa76 commit da5bdb4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
12 changes: 6 additions & 6 deletions capi/geos_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ extern "C" {
//------------------------------------------------------------------

char
GEOSRelatePattern(const Geometry* g1, const Geometry* g2, const char* pat)
GEOSRelatePattern(const Geometry* g1, const Geometry* g2, const char* imPattern)
{
return GEOSRelatePattern_r(handle, g1, g2, pat);
return GEOSRelatePattern_r(handle, g1, g2, imPattern);
}

char
GEOSRelatePatternMatch(const char* mat, const char* pat)
GEOSRelatePatternMatch(const char* intMatrix, const char* imPattern)
{
return GEOSRelatePatternMatch_r(handle, mat, pat);
return GEOSRelatePatternMatch_r(handle, intMatrix, imPattern);
}

char*
Expand Down Expand Up @@ -1610,9 +1610,9 @@ extern "C" {
}

char
GEOSPreparedRelatePattern(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2, const char* pat)
GEOSPreparedRelatePattern(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2, const char* imPattern)
{
return GEOSPreparedRelatePattern_r(handle, pg1, g2, pat);
return GEOSPreparedRelatePattern_r(handle, pg1, g2, imPattern);
}

CoordinateSequence*
Expand Down
22 changes: 11 additions & 11 deletions capi/geos_c.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ extern char GEOS_DLL GEOSRelatePattern_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2,
const char *pat);
const char *imPattern);

/** \see GEOSRelate */
extern char GEOS_DLL *GEOSRelate_r(
Expand All @@ -1441,8 +1441,8 @@ extern char GEOS_DLL *GEOSRelate_r(
/** \see GEOSRelatePatternMatch */
extern char GEOS_DLL GEOSRelatePatternMatch_r(
GEOSContextHandle_t handle,
const char *mat,
const char *pat);
const char *intMatrix,
const char *imPattern);

/** \see GEOSRelateBoundaryNodeRule */
extern char GEOS_DLL *GEOSRelateBoundaryNodeRule_r(
Expand Down Expand Up @@ -4935,14 +4935,14 @@ extern char GEOS_DLL GEOSEqualsIdentical(
* \see geos::geom::Geometry::relate
* \param g1 First geometry in pair
* \param g2 Second geometry in pair
* \param pat DE9IM pattern to check
* \param imPattern DE9IM pattern to check
* \return 1 on true, 0 on false, 2 on exception
* \since 2.2
*/
extern char GEOS_DLL GEOSRelatePattern(
const GEOSGeometry* g1,
const GEOSGeometry* g2,
const char *pat);
const char *imPattern);

/**
* Calculate and return the DE9IM pattern for this geometry pair.
Expand All @@ -4960,15 +4960,15 @@ extern char GEOS_DLL *GEOSRelate(
/**
* Compare two DE9IM patterns and return true if they
* are consistent.
* \param mat Complete DE9IM string (does not have "*")
* \param pat Pattern to match to (may contain "*")
* \param intMatrix Complete DE9IM string (does not have "*")
* \param imPattern Pattern to match to (may contain "*")
* \return 1 on true, 0 on false, 2 on exception
*
* \since 3.3
*/
extern char GEOS_DLL GEOSRelatePatternMatch(
const char *mat,
const char *pat);
const char *intMatrix,
const char *imPattern);

/**
* Calculate and return the DE9IM pattern for this geometry pair.
Expand Down Expand Up @@ -5226,7 +5226,7 @@ extern char GEOS_DLL * GEOSPreparedRelate(
* prepared and provided geometry.
* \param pg1 The prepared geometry
* \param g2 The geometry to test
* \param pat The DE9IM pattern to test
* \param imPattern The DE9IM pattern to test
* \returns 1 on true, 0 on false, 2 on exception
* \see GEOSPrepare
* \see GEOSRelatePattern
Expand All @@ -5237,7 +5237,7 @@ extern char GEOS_DLL * GEOSPreparedRelate(
extern char GEOS_DLL GEOSPreparedRelatePattern(
const GEOSPreparedGeometry* pg1,
const GEOSGeometry* g2,
const char* pat);
const char* imPattern);

/**
* Use a \ref GEOSPreparedGeometry do a high performance
Expand Down
16 changes: 8 additions & 8 deletions capi/geos_ts_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,23 +665,23 @@ extern "C" {
//------------------------------------------------------------------

char
GEOSRelatePattern_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2, const char* pat)
GEOSRelatePattern_r(GEOSContextHandle_t extHandle, const Geometry* g1, const Geometry* g2, const char* imPattern)
{
return execute(extHandle, 2, [&]() {
std::string s(pat);
std::string s(imPattern);
return g1->relate(g2, s);
});
}

char
GEOSRelatePatternMatch_r(GEOSContextHandle_t extHandle, const char* mat,
const char* pat)
GEOSRelatePatternMatch_r(GEOSContextHandle_t extHandle, const char* intMatrix,
const char* imPattern)
{
return execute(extHandle, 2, [&]() {
using geos::geom::IntersectionMatrix;

std::string m(mat);
std::string p(pat);
std::string m(intMatrix);
std::string p(imPattern);
IntersectionMatrix im(m);

return im.matches(p);
Expand Down Expand Up @@ -3761,10 +3761,10 @@ extern "C" {

char
GEOSPreparedRelatePattern_r(GEOSContextHandle_t extHandle,
const geos::geom::prep::PreparedGeometry* pg, const Geometry* g, const char* pat)
const geos::geom::prep::PreparedGeometry* pg, const Geometry* g, const char* imPattern)
{
return execute(extHandle, 2, [&]() {
return pg->relate(g, std::string(pat));
return pg->relate(g, std::string(imPattern));
});
}

Expand Down

0 comments on commit da5bdb4

Please sign in to comment.