PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ ST_RelateMatch()

Datum ST_RelateMatch ( PG_FUNCTION_ARGS  )

Definition at line 41 of file lwgeom_geos_relatematch.c.

References lwfree(), lwgeom_geos_errmsg, lwgeom_geos_error(), POSTGIS_GEOS_VERSION, and text2cstring().

42 {
43 #if POSTGIS_GEOS_VERSION < 33
44  lwpgerror("The GEOS version this postgis binary "
45  "was compiled against (%d) doesn't support "
46  "'ST_RelateMatch' function (3.3.0+ required)",
48  PG_RETURN_NULL();
49 #else /* POSTGIS_GEOS_VERSION >= 33 */
50 
51  char *mat, *pat;
52  text *mat_text, *pat_text;
53  int result;
54 
55  /* Read the arguments */
56  mat_text = (PG_GETARG_TEXT_P(0));
57  pat_text = (PG_GETARG_TEXT_P(1));
58 
59  /* Convert from text to cstring */
60  mat = text2cstring(mat_text);
61  pat = text2cstring(pat_text);
62 
63  initGEOS(lwpgnotice, lwgeom_geos_error);
64 
65  result = GEOSRelatePatternMatch(mat, pat);
66  if (result == 2)
67  {
68  lwfree(mat); lwfree(pat);
69  lwpgerror("GEOSRelatePatternMatch: %s", lwgeom_geos_errmsg);
70  PG_RETURN_NULL();
71  }
72 
73  lwfree(mat); lwfree(pat);
74  PG_RETURN_BOOL(result);
75 
76 #endif /* POSTGIS_GEOS_VERSION >= 33 */
77 
78 }
#define POSTGIS_GEOS_VERSION
Definition: sqldefines.h:10
void lwfree(void *mem)
Definition: lwutil.c:214
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
void lwgeom_geos_error(const char *fmt,...)
char * text2cstring(const text *textptr)
Here is the call graph for this function: