933{
936 uint64_t i;
937
938
939 i = 1;
940 LWDEBUG(1,
"calling lwt_be_getEdgeById");
942 LWDEBUGF(1,
"lwt_be_getEdgeById returned %p", *oldedge);
943 if ( ! *oldedge )
944 {
945 LWDEBUGF(1,
"lwt_be_getEdgeById returned NULL and set i=%d", i);
946 if (i == UINT64_MAX)
947 {
949 return NULL;
950 }
951 else if ( i == 0 )
952 {
953 lwerror(
"SQL/MM Spatial exception - non-existent edge");
954 return NULL;
955 }
956 else
957 {
958 lwerror(
"Backend coding error: getEdgeById callback returned NULL "
959 "but numelements output parameter has value %d "
960 "(expected 0 or 1)", i);
961 return NULL;
962 }
963 }
964
965
966
967
968
969 if ( ! skipISOChecks )
970 {
971 LWDEBUG(1,
"calling lwt_be_ExistsCoincidentNode");
973 {
974 LWDEBUG(1,
"lwt_be_ExistsCoincidentNode returned");
976 lwerror(
"SQL/MM Spatial exception - coincident node");
977 return NULL;
978 }
979 LWDEBUG(1,
"lwt_be_ExistsCoincidentNode returned");
980 }
981
982
984 if ( ! split )
985 {
987 lwerror(
"could not split edge by point ?");
988 return NULL;
989 }
991 if ( ! split_col ) {
994 lwerror(
"lwgeom_as_lwcollection returned NULL");
995 return NULL;
996 }
997 if (split_col->
ngeoms < 2) {
1000 lwerror(
"SQL/MM Spatial exception - point not on edge");
1001 return NULL;
1002 }
1003
1004#if 0
1005 {
1006 size_t sz;
1008 LWDEBUGF(1,
"returning split col: %s", wkt);
1010 }
1011#endif
1012 return split_col;
1013}
LWGEOM * lwgeom_split(const LWGEOM *lwgeom_in, const LWGEOM *blade_in)
void lwgeom_free(LWGEOM *geom)
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
int lwt_be_ExistsCoincidentNode(LWT_TOPOLOGY *topo, LWPOINT *pt)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
static void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
const LWT_BE_IFACE * be_iface