PostGIS  2.4.9dev-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(), and text2cstring().

42 {
43  char *mat, *pat;
44  text *mat_text, *pat_text;
45  int result;
46 
47  /* Read the arguments */
48  mat_text = (PG_GETARG_TEXT_P(0));
49  pat_text = (PG_GETARG_TEXT_P(1));
50 
51  /* Convert from text to cstring */
52  mat = text2cstring(mat_text);
53  pat = text2cstring(pat_text);
54 
55  initGEOS(lwpgnotice, lwgeom_geos_error);
56 
57  result = GEOSRelatePatternMatch(mat, pat);
58  if (result == 2)
59  {
60  lwfree(mat); lwfree(pat);
61  lwpgerror("GEOSRelatePatternMatch: %s", lwgeom_geos_errmsg);
62  PG_RETURN_NULL();
63  }
64 
65  lwfree(mat); lwfree(pat);
66  PG_RETURN_BOOL(result);
67 }
void lwfree(void *mem)
Definition: lwutil.c:244
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: