972{
975 GEOSGeometry *g1, *g2;
976 char *relate_str;
978 int bnr = GEOSRELATE_BNR_OGC;
979
980
982
983 if ( PG_NARGS() > 2 )
984 bnr = PG_GETARG_INT32(2);
985
987
989 if (!g1)
992 if (!g2)
993 {
994 GEOSGeom_destroy(g1);
996 }
997
998 POSTGIS_DEBUG(3, "constructed geometries ");
999
1000 POSTGIS_DEBUGF(3, "%s", GEOSGeomToWKT(g1));
1001 POSTGIS_DEBUGF(3, "%s", GEOSGeomToWKT(g2));
1002
1003 relate_str = GEOSRelateBoundaryNodeRule(g1, g2, bnr);
1004 if (!relate_str) {
1005 GEOSGeom_destroy(g1);
1006 GEOSGeom_destroy(g2);
1008 }
1009 result = cstring_to_text(relate_str);
1010 GEOSFree(relate_str);
1011 GEOSGeom_destroy(g1);
1012 GEOSGeom_destroy(g2);
1013
1014 PG_FREE_IF_COPY(geom1, 0);
1015 PG_FREE_IF_COPY(geom2, 1);
1016
1017 PG_RETURN_TEXT_P(
result);
1018}
char result[OUT_DOUBLE_BUFFER_SIZE]
void gserialized_error_if_srid_mismatch(const GSERIALIZED *g1, const GSERIALIZED *g2, const char *funcname)
void lwgeom_geos_error(const char *fmt,...)
GEOSGeometry * POSTGIS2GEOS(const GSERIALIZED *pglwgeom)
#define HANDLE_GEOS_ERROR(label)